91 implicit none ;
private 93 #include <MOM_memory.h> 101 integer,
parameter ::
ntr = 2
104 real,
dimension(:,:,:),
pointer :: p => null()
108 character(len=200) :: ic_file
111 type(time_type),
pointer :: time
113 real,
pointer,
dimension(:,:,:) :: &
116 cfc11_aux => null(), &
119 real :: a1_11, a2_11, a3_11, a4_11
120 real :: a1_12, a2_12, a3_12, a4_12
122 real :: d1_11, d2_11, d3_11, d4_11
123 real :: d1_12, d2_12, d3_12, d4_12
125 real :: e1_11, e2_11, e3_11
126 real :: e1_12, e2_12, e3_12
128 type(
p3d),
dimension(NTR) :: &
133 real :: cfc11_ic_val = 0.0
134 real :: cfc12_ic_val = 0.0
135 real :: cfc11_land_val = -1.0
136 real :: cfc12_land_val = -1.0
137 logical :: mask_tracers
138 logical :: tracers_may_reinit
141 character(len=16) :: cfc11_name, cfc12_name
143 integer :: ind_cfc_11_flux
144 integer :: ind_cfc_12_flux
150 integer :: id_cfc11, id_cfc12
151 integer,
dimension(NTR) :: id_tr_adx = -1, id_tr_ady = -1
152 integer,
dimension(NTR) :: id_tr_dfx = -1, id_tr_dfy = -1
180 #include "version_variable.h" 181 character(len=40) :: mdl =
"MOM_OCMIP2_CFC" 182 character(len=200) :: inputdir
184 character(len=128) :: default_ice_restart_file =
'ice_ocmip2_cfc.res.nc' 185 character(len=128) :: default_ocean_restart_file =
'ocmip2_cfc.res.nc' 186 real,
dimension(:,:,:),
pointer :: tr_ptr
187 real :: a11_dflt(4), a12_dflt(4)
188 real :: d11_dflt(4), d12_dflt(4)
189 real :: e11_dflt(3), e12_dflt(3)
190 logical :: register_OCMIP2_CFC
191 integer :: isd, ied, jsd, jed, nz, m
193 isd = hi%isd ; ied = hi%ied ; jsd = hi%jsd ; jed = hi%jed ; nz = gv%ke
195 if (
associated(cs))
then 196 call mom_error(warning,
"register_OCMIP2_CFC called with an "// &
197 "associated control structure.")
204 flux_type =
'air_sea_gas_flux', implementation =
'ocmip2', &
205 param = (/ 9.36e-07, 9.7561e-06 /), &
206 ice_restart_file = default_ice_restart_file, &
207 ocean_restart_file = default_ocean_restart_file, &
208 caller =
"register_OCMIP2_CFC")
210 flux_type =
'air_sea_gas_flux', implementation =
'ocmip2', &
211 param = (/ 9.36e-07, 9.7561e-06 /), &
212 ice_restart_file = default_ice_restart_file, &
213 ocean_restart_file = default_ocean_restart_file, &
214 caller =
"register_OCMIP2_CFC")
215 if ((cs%ind_cfc_11_flux < 0) .or. (cs%ind_cfc_11_flux < 0))
then 218 call mom_error(warning,
"CFCs are currently only set up to be run in " // &
219 " coupled model configurations, and will be disabled.")
221 register_ocmip2_cfc = .false.
227 call get_param(param_file, mdl,
"CFC_IC_FILE", cs%IC_file, &
228 "The file in which the CFC initial values can be \n"//&
229 "found, or an empty string for internal initialization.", &
231 if ((len_trim(cs%IC_file) > 0) .and. (scan(cs%IC_file,
'/') == 0))
then 233 call get_param(param_file, mdl,
"INPUTDIR", inputdir, default=
".")
234 cs%IC_file = trim(slasher(inputdir))//trim(cs%IC_file)
235 call log_param(param_file, mdl,
"INPUTDIR/CFC_IC_FILE", cs%IC_file)
237 call get_param(param_file, mdl,
"CFC_IC_FILE_IS_Z", cs%Z_IC_file, &
238 "If true, CFC_IC_FILE is in depth space, not layer space", &
240 call get_param(param_file, mdl,
"MASK_MASSLESS_TRACERS", cs%mask_tracers, &
241 "If true, the tracers are masked out in massless layer. \n"//&
242 "This can be a problem with time-averages.", default=.false.)
243 call get_param(param_file, mdl,
"TRACERS_MAY_REINIT", cs%tracers_may_reinit, &
244 "If true, tracers may go through the initialization code \n"//&
245 "if they are not found in the restart files. Otherwise \n"//&
246 "it is a fatal error if tracers are not found in the \n"//&
247 "restart files of a restarted run.", default=.false.)
251 cs%CFC11_name =
"CFC11" ; cs%CFC12_name =
"CFC12" 252 cs%CFC11_desc =
var_desc(cs%CFC11_name,
"mol m-3",
"CFC-11 Concentration", caller=mdl)
253 cs%CFC12_desc =
var_desc(cs%CFC12_name,
"mol m-3",
"CFC-12 Concentration", caller=mdl)
255 allocate(cs%CFC11(isd:ied,jsd:jed,nz)) ; cs%CFC11(:,:,:) = 0.0
256 allocate(cs%CFC12(isd:ied,jsd:jed,nz)) ; cs%CFC12(:,:,:) = 0.0
257 if (cs%mask_tracers)
then 258 allocate(cs%CFC11_aux(isd:ied,jsd:jed,nz)) ; cs%CFC11_aux(:,:,:) = 0.0
259 allocate(cs%CFC12_aux(isd:ied,jsd:jed,nz)) ; cs%CFC12_aux(:,:,:) = 0.0
267 .not.cs%tracers_may_reinit, restart_cs)
269 call register_tracer(tr_ptr, cs%CFC11_desc, param_file, hi, gv, tr_reg, &
270 tr_desc_ptr=cs%CFC11_desc)
274 .not.cs%tracers_may_reinit, restart_cs)
275 call register_tracer(tr_ptr, cs%CFC12_desc, param_file, hi, gv, tr_reg, &
276 tr_desc_ptr=cs%CFC12_desc)
284 a11_dflt(:) = (/ 3501.8, -210.31, 6.1851, -0.07513 /)
285 a12_dflt(:) = (/ 3845.4, -228.95, 6.1908, -0.06743 /)
286 call get_param(param_file, mdl,
"CFC11_A1", cs%a1_11, &
287 "A coefficient in the Schmidt number of CFC11.", &
288 units=
"nondim", default=a11_dflt(1))
289 call get_param(param_file, mdl,
"CFC11_A2", cs%a2_11, &
290 "A coefficient in the Schmidt number of CFC11.", &
291 units=
"degC-1", default=a11_dflt(2))
292 call get_param(param_file, mdl,
"CFC11_A3", cs%a3_11, &
293 "A coefficient in the Schmidt number of CFC11.", &
294 units=
"degC-2", default=a11_dflt(3))
295 call get_param(param_file, mdl,
"CFC11_A4", cs%a4_11, &
296 "A coefficient in the Schmidt number of CFC11.", &
297 units=
"degC-3", default=a11_dflt(4))
299 call get_param(param_file, mdl,
"CFC12_A1", cs%a1_12, &
300 "A coefficient in the Schmidt number of CFC12.", &
301 units=
"nondim", default=a12_dflt(1))
302 call get_param(param_file, mdl,
"CFC12_A2", cs%a2_12, &
303 "A coefficient in the Schmidt number of CFC12.", &
304 units=
"degC-1", default=a12_dflt(2))
305 call get_param(param_file, mdl,
"CFC12_A3", cs%a3_12, &
306 "A coefficient in the Schmidt number of CFC12.", &
307 units=
"degC-2", default=a12_dflt(3))
308 call get_param(param_file, mdl,
"CFC12_A4", cs%a4_12, &
309 "A coefficient in the Schmidt number of CFC12.", &
310 units=
"degC-3", default=a12_dflt(4))
316 d11_dflt(:) = (/ -229.9261, 319.6552, 119.4471, -1.39165 /)
317 e11_dflt(:) = (/ -0.142382, 0.091459, -0.0157274 /)
318 d12_dflt(:) = (/ -218.0971, 298.9702, 113.8049, -1.39165 /)
319 e12_dflt(:) = (/ -0.143566, 0.091015, -0.0153924 /)
321 call get_param(param_file, mdl,
"CFC11_D1", cs%d1_11, &
322 "A coefficient in the solubility of CFC11.", &
323 units=
"none", default=d11_dflt(1))
324 call get_param(param_file, mdl,
"CFC11_D2", cs%d2_11, &
325 "A coefficient in the solubility of CFC11.", &
326 units=
"hK", default=d11_dflt(2))
327 call get_param(param_file, mdl,
"CFC11_D3", cs%d3_11, &
328 "A coefficient in the solubility of CFC11.", &
329 units=
"none", default=d11_dflt(3))
330 call get_param(param_file, mdl,
"CFC11_D4", cs%d4_11, &
331 "A coefficient in the solubility of CFC11.", &
332 units=
"hK-2", default=d11_dflt(4))
333 call get_param(param_file, mdl,
"CFC11_E1", cs%e1_11, &
334 "A coefficient in the solubility of CFC11.", &
335 units=
"PSU-1", default=e11_dflt(1))
336 call get_param(param_file, mdl,
"CFC11_E2", cs%e2_11, &
337 "A coefficient in the solubility of CFC11.", &
338 units=
"PSU-1 hK-1", default=e11_dflt(2))
339 call get_param(param_file, mdl,
"CFC11_E3", cs%e3_11, &
340 "A coefficient in the solubility of CFC11.", &
341 units=
"PSU-1 hK-2", default=e11_dflt(3))
343 call get_param(param_file, mdl,
"CFC12_D1", cs%d1_12, &
344 "A coefficient in the solubility of CFC12.", &
345 units=
"none", default=d12_dflt(1))
346 call get_param(param_file, mdl,
"CFC12_D2", cs%d2_12, &
347 "A coefficient in the solubility of CFC12.", &
348 units=
"hK", default=d12_dflt(2))
349 call get_param(param_file, mdl,
"CFC12_D3", cs%d3_12, &
350 "A coefficient in the solubility of CFC12.", &
351 units=
"none", default=d12_dflt(3))
352 call get_param(param_file, mdl,
"CFC12_D4", cs%d4_12, &
353 "A coefficient in the solubility of CFC12.", &
354 units=
"hK-2", default=d12_dflt(4))
355 call get_param(param_file, mdl,
"CFC12_E1", cs%e1_12, &
356 "A coefficient in the solubility of CFC12.", &
357 units=
"PSU-1", default=e12_dflt(1))
358 call get_param(param_file, mdl,
"CFC12_E2", cs%e2_12, &
359 "A coefficient in the solubility of CFC12.", &
360 units=
"PSU-1 hK-1", default=e12_dflt(2))
361 call get_param(param_file, mdl,
"CFC12_E3", cs%e3_12, &
362 "A coefficient in the solubility of CFC12.", &
363 units=
"PSU-1 hK-2", default=e12_dflt(3))
366 cs%restart_CSp => restart_cs
368 register_ocmip2_cfc = .true.
373 sponge_CSp, diag_to_Z_CSp)
374 logical,
intent(in) :: restart
376 type(time_type),
target,
intent(in) :: day
379 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
382 type(
diag_ctrl),
target,
intent(in) :: diag
412 logical :: from_file = .false.
413 character(len=16) :: name
414 character(len=72) :: longname
415 character(len=48) :: units
416 character(len=48) :: flux_units
417 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz, m
418 integer :: IsdB, IedB, JsdB, JedB
420 if (.not.
associated(cs))
return 421 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = gv%ke
422 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
423 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
428 if (.not.restart .or. (cs%tracers_may_reinit .and. &
431 cs%CFC11_IC_val, g, cs)
433 if (.not.restart .or. (cs%tracers_may_reinit .and. &
436 cs%CFC12_IC_val, g, cs)
438 if (
associated(obc))
then 447 if (gv%Boussinesq)
then ; flux_units =
"mol s-1" 448 else ; flux_units =
"mol m-3 kg s-1" ;
endif 455 call query_vardesc(cs%CFC11_desc, name, units=units, longname=longname, &
456 caller=
"initialize_OCMIP2_CFC")
457 cs%id_CFC11 = register_diag_field(
"ocean_model", trim(name), cs%diag%axesTL, &
458 day, trim(longname) , trim(units))
460 day, g, diag_to_z_csp)
463 call query_vardesc(cs%CFC12_desc, name, units=units, longname=longname, &
464 caller=
"initialize_OCMIP2_CFC")
465 cs%id_CFC12 = register_diag_field(
"ocean_model", trim(name), cs%diag%axesTL, &
466 day, trim(longname) , trim(units))
468 day, g, diag_to_z_csp)
470 call mom_error(fatal,
"initialize_OCMIP2_CFC is only set up to work"//&
474 cs%id_tr_adx(m) = register_diag_field(
"ocean_model", trim(name)//
"_adx", &
475 cs%diag%axesCuL, day, trim(longname)//
" advective zonal flux" , &
477 cs%id_tr_ady(m) = register_diag_field(
"ocean_model", trim(name)//
"_ady", &
478 cs%diag%axesCvL, day, trim(longname)//
" advective meridional flux" , &
480 cs%id_tr_dfx(m) = register_diag_field(
"ocean_model", trim(name)//
"_dfx", &
481 cs%diag%axesCuL, day, trim(longname)//
" diffusive zonal flux" , &
483 cs%id_tr_dfy(m) = register_diag_field(
"ocean_model", trim(name)//
"_dfy", &
484 cs%diag%axesCvL, day, trim(longname)//
" diffusive zonal flux" , &
486 if (cs%id_tr_adx(m) > 0)
call safe_alloc_ptr(cs%tr_adx(m)%p,isdb,iedb,jsd,jed,nz)
487 if (cs%id_tr_ady(m) > 0)
call safe_alloc_ptr(cs%tr_ady(m)%p,isd,ied,jsdb,jedb,nz)
488 if (cs%id_tr_dfx(m) > 0)
call safe_alloc_ptr(cs%tr_dfx(m)%p,isdb,iedb,jsd,jed,nz)
489 if (cs%id_tr_dfy(m) > 0)
call safe_alloc_ptr(cs%tr_dfy(m)%p,isd,ied,jsdb,jedb,nz)
492 if ((cs%id_tr_adx(m) > 0) .or. (cs%id_tr_ady(m) > 0) .or. &
493 (cs%id_tr_dfx(m) > 0) .or. (cs%id_tr_dfy(m) > 0)) &
495 cs%tr_ady(m)%p,cs%tr_dfx(m)%p,cs%tr_dfy(m)%p)
502 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
503 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(out) :: tr
504 character(len=*),
intent(in) :: name
505 real,
intent(in) :: land_val, IC_val
511 integer :: i, j, k, is, ie, js, je, nz
512 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
514 if (len_trim(cs%IC_file) > 0)
then 517 call mom_error(fatal,
"initialize_OCMIP2_CFC: Unable to open "//cs%IC_file)
518 if (cs%Z_IC_file)
then 522 if (.not.ok)
call mom_error(fatal,
"initialize_OCMIP2_CFC: "//&
523 "Unable to read "//trim(name)//
" from "//&
524 trim(cs%IC_file)//
".")
527 call read_data(cs%IC_file, trim(name), tr, domain=g%Domain%mpp_domain)
530 do k=1,nz ;
do j=js,je ;
do i=is,ie
531 if (g%mask2dT(i,j) < 0.5)
then 536 enddo ;
enddo ;
enddo 546 evap_CFL_limit, minimum_forcing_depth)
549 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
552 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
555 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
559 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
563 type(
forcing),
intent(in) :: fluxes
566 real,
intent(in) :: dt
570 real,
optional,
intent(in) :: evap_CFL_limit
571 real,
optional,
intent(in) :: minimum_forcing_depth
597 real :: c1(szi_(g),szk_(g))
598 real,
dimension(SZI_(G),SZJ_(G)) :: &
601 real,
pointer,
dimension(:,:,:) :: CFC11, CFC12
602 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_work
603 integer :: i, j, k, is, ie, js, je, nz, m
605 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = gv%ke
607 if (.not.
associated(cs))
return 609 cfc11 => cs%CFC11 ; cfc12 => cs%CFC12
614 call extract_coupler_values(fluxes%tr_fluxes, cs%ind_cfc_11_flux, ind_flux, &
615 cfc11_flux, is, ie, js, je, -gv%Rho0)
616 call extract_coupler_values(fluxes%tr_fluxes, cs%ind_cfc_12_flux, ind_flux, &
617 cfc12_flux, is, ie, js, je, -gv%Rho0)
621 if (
present(evap_cfl_limit) .and.
present(minimum_forcing_depth))
then 622 do k=1,nz ;
do j=js,je ;
do i=is,ie
623 h_work(i,j,k) = h_old(i,j,k)
624 enddo ;
enddo ; enddo;
626 evap_cfl_limit, minimum_forcing_depth)
627 call tracer_vertdiff(h_work, ea, eb, dt, cfc11, g, gv, sfc_flux=cfc11_flux)
629 do k=1,nz ;
do j=js,je ;
do i=is,ie
630 h_work(i,j,k) = h_old(i,j,k)
631 enddo ;
enddo ; enddo;
633 evap_cfl_limit, minimum_forcing_depth)
634 call tracer_vertdiff(h_work, ea, eb, dt, cfc12, g, gv, sfc_flux=cfc12_flux)
636 call tracer_vertdiff(h_old, ea, eb, dt, cfc11, g, gv, sfc_flux=cfc11_flux)
637 call tracer_vertdiff(h_old, ea, eb, dt, cfc12, g, gv, sfc_flux=cfc12_flux)
641 if (cs%mask_tracers)
then 642 do k=1,nz ;
do j=js,je ;
do i=is,ie
643 if (h_new(i,j,k) < 1.1*gv%Angstrom)
then 644 cs%CFC11_aux(i,j,k) = cs%CFC11_land_val
645 cs%CFC12_aux(i,j,k) = cs%CFC12_land_val
647 cs%CFC11_aux(i,j,k) = cfc11(i,j,k)
648 cs%CFC12_aux(i,j,k) = cfc12(i,j,k)
650 enddo ;
enddo ;
enddo 651 if (cs%id_CFC11>0)
call post_data(cs%id_CFC11, cs%CFC11_aux, cs%diag)
652 if (cs%id_CFC12>0)
call post_data(cs%id_CFC12, cs%CFC12_aux, cs%diag)
654 if (cs%id_CFC11>0)
call post_data(cs%id_CFC11, cfc11, cs%diag)
655 if (cs%id_CFC12>0)
call post_data(cs%id_CFC12, cfc12, cs%diag)
658 if (cs%id_tr_adx(m)>0) &
659 call post_data(cs%id_tr_adx(m),cs%tr_adx(m)%p(:,:,:),cs%diag)
660 if (cs%id_tr_ady(m)>0) &
661 call post_data(cs%id_tr_ady(m),cs%tr_ady(m)%p(:,:,:),cs%diag)
662 if (cs%id_tr_dfx(m)>0) &
663 call post_data(cs%id_tr_dfx(m),cs%tr_dfx(m)%p(:,:,:),cs%diag)
664 if (cs%id_tr_dfy(m)>0) &
665 call post_data(cs%id_tr_dfy(m),cs%tr_dfy(m)%p(:,:,:),cs%diag)
676 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
679 real,
dimension(:),
intent(out) :: stocks
684 character(len=*),
dimension(:),
intent(out) :: names
685 character(len=*),
dimension(:),
intent(out) :: units
686 integer,
optional,
intent(in) :: stock_index
688 integer :: OCMIP2_CFC_stock
706 integer :: i, j, k, is, ie, js, je, nz
707 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = gv%ke
710 if (.not.
associated(cs))
return 712 if (
present(stock_index))
then ;
if (stock_index > 0)
then 719 call query_vardesc(cs%CFC11_desc, name=names(1), units=units(1), caller=
"OCMIP2_CFC_stock")
720 call query_vardesc(cs%CFC12_desc, name=names(2), units=units(2), caller=
"OCMIP2_CFC_stock")
721 units(1) = trim(units(1))//
" kg" ; units(2) = trim(units(2))//
" kg" 723 stocks(1) = 0.0 ; stocks(2) = 0.0
724 do k=1,nz ;
do j=js,je ;
do i=is,ie
725 mass = g%mask2dT(i,j) * g%areaT(i,j) * h(i,j,k)
726 stocks(1) = stocks(1) + cs%CFC11(i,j,k) * mass
727 stocks(2) = stocks(2) + cs%CFC12(i,j,k) * mass
728 enddo ;
enddo ;
enddo 729 stocks(1) = gv%H_to_kg_m2 * stocks(1)
730 stocks(2) = gv%H_to_kg_m2 * stocks(2)
738 type(
surface),
intent(inout) :: state
739 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
753 real,
dimension(SZI_(G),SZJ_(G)) :: &
765 integer :: i, j, k, is, ie, js, je, m
767 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
769 if (.not.
associated(cs))
return 771 do j=js,je ;
do i=is,ie
772 ta = max(0.01, (state%SST(i,j) + 273.15) * 0.01)
773 sal = state%SSS(i,j) ; sst = state%SST(i,j)
778 alpha_11 = exp(cs%d1_11 + cs%d2_11/ta + cs%d3_11*log(ta) + cs%d4_11*ta**2 +&
779 sal * ((cs%e3_11 * ta + cs%e2_11) * ta + cs%e1_11)) * &
780 1.0e-09 * g%mask2dT(i,j)
781 alpha_12 = exp(cs%d1_12 + cs%d2_12/ta + cs%d3_12*log(ta) + cs%d4_12*ta**2 +&
782 sal * ((cs%e3_12 * ta + cs%e2_12) * ta + cs%e1_12)) * &
783 1.0e-09 * g%mask2dT(i,j)
786 sc_11 = cs%a1_11 + sst * (cs%a2_11 + sst * (cs%a3_11 + sst * cs%a4_11)) * &
788 sc_12 = cs%a1_12 + sst * (cs%a2_12 + sst * (cs%a3_12 + sst * cs%a4_12)) * &
791 sc_no_term = sqrt(660.0 / (abs(sc_11) + 1.0e-30))
792 cfc11_alpha(i,j) = alpha_11 * sc_no_term
793 cfc11_csurf(i,j) = cs%CFC11(i,j,1) * sc_no_term
795 sc_no_term = sqrt(660.0 / (abs(sc_12) + 1.0e-30))
796 cfc12_alpha(i,j) = alpha_12 * sc_no_term
797 cfc12_csurf(i,j) = cs%CFC12(i,j,1) * sc_no_term
802 call set_coupler_values(cfc11_alpha, state%tr_fields, cs%ind_cfc_11_flux, &
803 ind_alpha, is, ie, js, je)
804 call set_coupler_values(cfc11_csurf, state%tr_fields, cs%ind_cfc_11_flux, &
805 ind_csurf, is, ie, js, je)
806 call set_coupler_values(cfc12_alpha, state%tr_fields, cs%ind_cfc_12_flux, &
807 ind_alpha, is, ie, js, je)
808 call set_coupler_values(cfc12_csurf, state%tr_fields, cs%ind_cfc_12_flux, &
809 ind_csurf, is, ie, js, je)
820 if (
associated(cs))
then 821 if (
associated(cs%CFC11))
deallocate(cs%CFC11)
822 if (
associated(cs%CFC12))
deallocate(cs%CFC12)
823 if (
associated(cs%CFC11_aux))
deallocate(cs%CFC11_aux)
824 if (
associated(cs%CFC12_aux))
deallocate(cs%CFC12_aux)
826 if (
associated(cs%tr_adx(m)%p))
deallocate(cs%tr_adx(m)%p)
827 if (
associated(cs%tr_ady(m)%p))
deallocate(cs%tr_ady(m)%p)
828 if (
associated(cs%tr_dfx(m)%p))
deallocate(cs%tr_dfx(m)%p)
829 if (
associated(cs%tr_dfy(m)%p))
deallocate(cs%tr_dfy(m)%p)
The following structure contains pointers to various fields which may be used describe the surface st...
type(vardesc) function, public var_desc(name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, conversion, caller)
Returns a vardesc type whose elements have been filled with the provided fields. The argument name is...
This module implements boundary forcing for MOM6.
integer function, public aof_set_coupler_flux(name, flux_type, implementation, atm_tr_index, param, flag, ice_restart_file, ocean_restart_file, units, caller)
logical function, public tracer_z_init(tr, h, filename, tr_name, G, missing_val, land_val)
Ocean grid type. See mom_grid for details.
Provides the ocean grid type.
subroutine, public extract_coupler_values(BC_struc, BC_index, BC_element, array_out, is, ie, js, je, conversion)
This module contains I/O framework code.
Defines the horizontal index type (hor_index_type) used for providing index ranges.
logical function, public register_ocmip2_cfc(HI, GV, param_file, CS, tr_Reg, restart_CS)
subroutine init_tracer_cfc(h, tr, name, land_val, IC_val, G, CS)
This subroutine initializes a tracer array.
Container for horizontal index ranges for data, computational and global domains. ...
subroutine, public register_tracer(tr1, tr_desc, param_file, HI, GV, Reg, tr_desc_ptr, ad_x, ad_y, df_x, df_y, OBC_inflow, OBC_in_u, OBC_in_v, ad_2d_x, ad_2d_y, df_2d_x, df_2d_y, advection_xy)
This subroutine registers a tracer to be advected and laterally diffused.
This module contains the tracer_registry_type and the subroutines that handle registration of tracers...
subroutine, public applytracerboundaryfluxesinout(G, GV, Tr, dt, fluxes, h, evap_CFL_limit, minimum_forcing_depth, in_flux_optional, out_flux_optional, update_h_opt)
This routine is modeled after applyBoundaryFluxesInOut in MOM_diabatic_aux.F90 NOTE: Please note that...
subroutine, public set_up_sponge_field(sp_val, f_ptr, G, nlay, CS, sp_val_i_mean)
Type to carry basic tracer information.
This module contains routines that implement physical fluxes of tracers (e.g. due to surface fluxes o...
subroutine, public register_z_tracer(tr_ptr, name, long_name, units, Time, G, CS, standard_name, cmor_field_name, cmor_long_name, cmor_units, cmor_standard_name)
This subroutine registers a tracer to be output in depth space.
subroutine, public add_tracer_obc_values(name, Reg, OBC_inflow, OBC_in_u, OBC_in_v)
This subroutine adds open boundary condition concentrations for a tracer that has previously been reg...
subroutine, public add_tracer_diagnostics(name, Reg, ad_x, ad_y, df_x, df_y, ad_2d_x, ad_2d_y, df_2d_x, df_2d_y, advection_xy)
This subroutine adds diagnostic arrays for a tracer that has previously been registered by a call to ...
Structure that contains pointers to the boundary forcing used to drive the liquid ocean simulated by ...
subroutine, public set_coupler_values(array_in, BC_struc, BC_index, BC_element, is, ie, js, je, conversion)
Type for describing a variable, typically a tracer.
subroutine, public tracer_vertdiff(h_old, ea, eb, dt, tr, G, GV, sfc_flux, btm_flux, btm_reservoir, sink_rate, convert_flux_in)
This subroutine solves a tridiagonal equation for the final tracer concentrations after the dual-entr...
integer function, public ocmip2_cfc_stock(h, stocks, G, GV, CS, names, units, stock_index)
This function calculates the mass-weighted integral of all tracer stocks, returning the number of sto...
subroutine, public ocmip2_cfc_end(CS)
subroutine, public ocmip2_cfc_surface_state(state, h, G, CS)
subroutine, public query_vardesc(vd, name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, conversion, caller)
This routine queries vardesc.
Controls where open boundary conditions are applied.
subroutine, public ocmip2_cfc_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, CS, evap_CFL_limit, minimum_forcing_depth)
This subroutine applies diapycnal diffusion and any other column.
subroutine, public initialize_ocmip2_cfc(restart, day, G, GV, h, diag, OBC, CS, sponge_CSp, diag_to_Z_CSp)
This subroutine initializes the NTR tracer fields in tr(:,:,:,:) and it sets up the tracer output...
subroutine, public mom_error(level, message, all_print)