52 use constants_mod,
only: pi
53 use mpp_mod,
only: input_nml_file
54 use platform_mod,
only: r4_kind, r8_kind, fms_path_len
59 public :: topography_init, &
85 module procedure get_topog_mean_1d_r4, get_topog_mean_1d_r8
86 module procedure get_topog_mean_2d_r4, get_topog_mean_2d_r8
110 module procedure get_topog_stdev_1d_r4, get_topog_stdev_1d_r8
111 module procedure get_topog_stdev_2d_r4, get_topog_stdev_2d_r8
130 module procedure get_ocean_frac_1d_r4, get_ocean_frac_1d_r8
131 module procedure get_ocean_frac_2d_r4, get_ocean_frac_2d_r8
151 module procedure get_ocean_mask_1d_r4, get_ocean_mask_1d_r8
152 module procedure get_ocean_mask_2d_r4, get_ocean_mask_2d_r8
171 module procedure get_water_frac_1d_r4, get_water_frac_1d_r8
172 module procedure get_water_frac_2d_r4, get_water_frac_2d_r8
191 module procedure get_water_mask_1d_r4, get_water_mask_1d_r8
192 module procedure get_water_mask_2d_r4, get_water_mask_2d_r8
196 module procedure interp_topog_1d_r4, interp_topog_1d_r8
197 module procedure interp_topog_2d_r4, interp_topog_2d_r8
201 module procedure find_indices_r4, find_indices_r8
205 module procedure input_data_r4, input_data_r8
209 module procedure interp_water_1d_r4, interp_water_1d_r8
210 module procedure interp_water_2d_r4, interp_water_2d_r8
214 module procedure determine_ocean_points_r4, determine_ocean_points_r8
220 character(len=FMS_PATH_LEN) :: topog_file =
'DATA/navy_topography.data', &
221 water_file =
'DATA/navy_pctwater.data'
222 namelist /topography_nml/ topog_file, water_file
224 integer,
parameter :: TOPOG_INDEX = 1
225 integer,
parameter :: WATER_INDEX = 2
226 logical :: file_is_opened(2) = .false.
256 integer :: ipts, jpts
257 integer,
parameter :: compute_stdev = 123
263 #include<file_version.h>
265 logical :: module_is_initialized = .false.
273 subroutine topography_init ()
274 if ( module_is_initialized )
return
277 module_is_initialized = .true.
278 end subroutine topography_init
285 function open_topog_file ( )
286 logical :: open_topog_file
287 real(kind=r4_kind) :: r_ipts, r_jpts
290 namelen = len(trim(topog_file))
291 if ( file_exists(topog_file) .AND. topog_file(namelen-2:namelen) ==
'.nc')
then
293 'Reading NetCDF formatted input data file: '//trim(topog_file), note)
294 if(.not. file_is_opened(topog_index) )
then
296 call mpp_error(fatal,
'topography_mod: Error in opening file '//trim(topog_file))
304 open_topog_file = .true.
305 file_is_opened(topog_index) = .true.
307 open_topog_file = .false.
310 end function open_topog_file
312 function open_water_file ( )
313 logical :: open_water_file
314 real(kind=r4_kind) :: r_ipts, r_jpts
317 namelen = len(trim(water_file))
318 if ( file_exists(water_file) .AND. water_file(namelen-2:namelen) ==
'.nc')
then
320 'Reading NetCDF formatted input data file: '//trim(water_file), note)
321 if(.not. file_is_opened(water_index) )
then
323 call mpp_error(fatal,
'topography_mod: Error in opening file '//trim(water_file))
331 open_water_file = .true.
332 file_is_opened(water_index) = .true.
334 open_water_file = .false.
337 end function open_water_file
346 integer :: iunit, ierr, io
350 read (input_nml_file, topography_nml, iostat=io)
355 if (
mpp_pe() == mpp_root_pe())
then
357 write (iunit, nml=topography_nml)
362 #include "topography_r4.fh"
363 #include "topography_r8.fh"
365 end module topography_mod
Opens a given netcdf or domain file.
Read data from a defined field in a file.
integer function, public check_nml_error(IOSTAT, NML_NAME)
Checks the iostat argument that is returned after reading a namelist and determines if the error code...
subroutine, public write_version_number(version, tag, unit)
Prints to the log file (or a specified unit) the version id string and tag name.
subroutine, public error_mesg(routine, message, level)
Print notes, warnings and error messages; terminates program for warning and error messages....
subroutine, public horiz_interp_del(Interp)
Deallocates memory used by "horiz_interp_type" variables. Must be called before reinitializing with h...
Subroutine for performing the horizontal interpolation between two grids.
integer function stdlog()
This function returns the current standard fortran unit numbers for log messages. Log messages,...
integer function mpp_pe()
Returns processor ID.
subroutine read_namelist
Reads the namelist file, write namelist to log file, and initializes constants.
type(fmsnetcdffile_t), dimension(2) fileobj
needed for fms2_io
Returns fractional area covered by ocean in a grid box. Returns fractional area covered by ocean in t...
Returns a land-ocean mask in a grid box.
Returns a "realistic" mean surface height field.
Returns fractional area covered by water.
Returns a land-water mask in a grid box.
Allocates space and initializes a derived-type variable that contains pre-computed interpolation indi...
Returns a standard deviation of higher resolution topography with the given model grid boxes.