This subroutine is used to register tracer fields.
67 type(hor_index_type),
intent(in) :: HI
68 type(verticalGrid_type),
intent(in) :: GV
69 type(param_file_type),
intent(in) :: param_file
71 type(RGC_tracer_CS),
pointer :: CS
73 type(tracer_registry_type),
pointer :: tr_Reg
74 type(MOM_restart_CS),
pointer :: restart_CS
76 character(len=80) :: name, longname
78 #include "version_variable.h"
79 character(len=40) :: mdl =
"RGC_tracer"
80 character(len=200) :: inputdir
81 real,
pointer :: tr_ptr(:,:,:) => null()
82 logical :: register_RGC_tracer
83 integer :: isd, ied, jsd, jed, nz, m
84 isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
86 if (
associated(cs))
then
87 call mom_error(warning,
"RGC_register_tracer called with an "// &
88 "associated control structure.")
94 call log_version(param_file, mdl, version,
"")
95 call get_param(param_file, mdl,
"RGC_TRACER_IC_FILE", cs%tracer_IC_file, &
96 "The name of a file from which to read the initial \n"//&
97 "conditions for the RGC tracers, or blank to initialize \n"//&
98 "them internally.", default=
" ")
99 if (len_trim(cs%tracer_IC_file) >= 1)
then
100 call get_param(param_file, mdl,
"INPUTDIR", inputdir, default=
".")
101 inputdir = slasher(inputdir)
102 cs%tracer_IC_file = trim(inputdir)//trim(cs%tracer_IC_file)
103 call log_param(param_file, mdl,
"INPUTDIR/RGC_TRACER_IC_FILE", &
106 call get_param(param_file, mdl,
"SPONGE", cs%use_sponge, &
107 "If true, sponges may be applied anywhere in the domain. \n"//&
108 "The exact location and properties of those sponges are \n"//&
109 "specified from MOM_initialization.F90.", default=.false.)
111 call get_param(param_file, mdl,
"LENLAT", cs%lenlat, &
112 "The latitudinal or y-direction length of the domain", &
113 fail_if_missing=.true., do_not_log=.true.)
115 call get_param(param_file, mdl,
"LENLON", cs%lenlon, &
116 "The longitudinal or x-direction length of the domain", &
117 fail_if_missing=.true., do_not_log=.true.)
119 call get_param(param_file, mdl,
"CONT_SHELF_LENGTH", cs%CSL, &
120 "The length of the continental shelf (x dir, km).", &
123 call get_param(param_file, mdl,
"LENSPONGE", cs%lensponge, &
124 "The length of the sponge layer (km).", &
127 allocate(cs%tr(isd:ied,jsd:jed,nz,ntr)) ; cs%tr(:,:,:,:) = 0.0
128 if (cs%mask_tracers)
then
129 allocate(cs%tr_aux(isd:ied,jsd:jed,nz,ntr)) ; cs%tr_aux(:,:,:,:) = 0.0
133 if (m < 10)
then ;
write(name,
'("tr_RGC",I1.1)') m
134 else ;
write(name,
'("tr_RGC",I2.2)') m ;
endif
135 write(longname,
'("Concentration of RGC Tracer ",I2.2)') m
136 cs%tr_desc(m) = var_desc(name, units=
"kg kg-1", longname=longname, caller=mdl)
139 tr_ptr => cs%tr(:,:,:,m)
141 call register_tracer(tr_ptr, tr_reg, param_file, hi, gv, &
142 name=name, longname=longname, units=
"kg kg-1", &
143 registry_diags=.true., flux_units=
"kg/s", &
144 restart_cs=restart_cs)
148 register_rgc_tracer = .true.