Initializes temperature and salinity for the SCM CVMix test example.
56 real,
dimension(NIMEM_,NJMEM_, NKMEM_),
intent(out) :: T
57 real,
dimension(NIMEM_,NJMEM_, NKMEM_),
intent(out) :: S
58 real,
dimension(NIMEM_,NJMEM_, NKMEM_),
intent(in) :: h
59 type(ocean_grid_type),
intent(in) :: G
60 type(verticalGrid_type),
intent(in) :: GV
61 type(unit_scale_type),
intent(in) :: US
62 type(param_file_type),
intent(in) :: param_file
63 logical,
optional,
intent(in) :: just_read_params
66 real :: UpperLayerTempMLD
67 real :: UpperLayerSaltMLD
68 real :: UpperLayerTemp
69 real :: UpperLayerSalt
70 real :: LowerLayerTemp
71 real :: LowerLayerSalt
72 real :: LowerLayerdTdz
73 real :: LowerLayerdSdz
74 real :: LowerLayerMinTemp
75 real :: zC, DZ, top, bottom
77 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, nz
79 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
80 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
83 just_read = .false. ;
if (
present(just_read_params)) just_read = just_read_params
85 if (.not.just_read)
call log_version(param_file, mdl, version)
86 call get_param(param_file, mdl,
"SCM_TEMP_MLD", upperlayertempmld, &
87 'Initial temp mixed layer depth', &
88 units=
'm', default=0.0, scale=us%m_to_Z, do_not_log=just_read)
89 call get_param(param_file, mdl,
"SCM_SALT_MLD", upperlayersaltmld, &
90 'Initial salt mixed layer depth', &
91 units=
'm', default=0.0, scale=us%m_to_Z, do_not_log=just_read)
92 call get_param(param_file, mdl,
"SCM_L1_SALT", upperlayersalt, &
93 'Layer 2 surface salinity', units=
'1e-3', default=35.0, do_not_log=just_read)
94 call get_param(param_file, mdl,
"SCM_L1_TEMP", upperlayertemp, &
95 'Layer 1 surface temperature', units=
'C', default=20.0, do_not_log=just_read)
96 call get_param(param_file, mdl,
"SCM_L2_SALT", lowerlayersalt, &
97 'Layer 2 surface salinity', units=
'1e-3', default=35.0, do_not_log=just_read)
98 call get_param(param_file, mdl,
"SCM_L2_TEMP", lowerlayertemp, &
99 'Layer 2 surface temperature', units=
'C', default=20.0, do_not_log=just_read)
100 call get_param(param_file, mdl,
"SCM_L2_DTDZ", lowerlayerdtdz, &
101 'Initial temperature stratification in layer 2', &
102 units=
'C/m', default=0.0, scale=us%Z_to_m, do_not_log=just_read)
103 call get_param(param_file, mdl,
"SCM_L2_DSDZ", lowerlayerdsdz, &
104 'Initial salinity stratification in layer 2', &
105 units=
'PPT/m', default=0.0, scale=us%Z_to_m, do_not_log=just_read)
106 call get_param(param_file, mdl,
"SCM_L2_MINTEMP",lowerlayermintemp, &
107 'Layer 2 minimum temperature', units=
'C', default=4.0, do_not_log=just_read)
109 if (just_read)
return
111 do j=js,je ;
do i=is,ie
115 bottom = bottom - h(i,j,k)*gv%H_to_Z
116 zc = 0.5*( top + bottom )
117 dz = min(0., zc + upperlayertempmld)
118 t(i,j,k) = max(lowerlayermintemp,lowerlayertemp + lowerlayerdtdz * dz)
119 dz = min(0., zc + upperlayersaltmld)
120 s(i,j,k) = lowerlayersalt + lowerlayerdsdz * dz