13 implicit none ;
private
15 #include <MOM_memory.h>
18 public initialize_ice_thickness
28 subroutine initialize_ice_thickness(h_shelf, area_shelf_h, hmask, G, US, PF)
30 real,
dimension(SZDI_(G),SZDJ_(G)), &
31 intent(inout) :: h_shelf
32 real,
dimension(SZDI_(G),SZDJ_(G)), &
33 intent(inout) :: area_shelf_h
34 real,
dimension(SZDI_(G),SZDJ_(G)), &
35 intent(inout) :: hmask
41 character(len=40) :: mdl =
"initialize_ice_thickness"
42 character(len=200) :: config
44 call get_param(pf, mdl,
"ICE_PROFILE_CONFIG", config, &
45 "This specifies how the initial ice profile is specified. "//&
46 "Valid values are: CHANNEL, FILE, and USER.", &
47 fail_if_missing=.true.)
49 select case ( trim(config) )
50 case (
"CHANNEL");
call initialize_ice_thickness_channel (h_shelf, area_shelf_h, hmask, g, us, pf)
51 case (
"FILE");
call initialize_ice_thickness_from_file (h_shelf, area_shelf_h, hmask, g, us, pf)
52 case (
"USER");
call user_init_ice_thickness (h_shelf, area_shelf_h, hmask, g, us, pf)
53 case default ;
call mom_error(fatal,
"MOM_initialize: "// &
54 "Unrecognized ice profile setup "//trim(config))
57 end subroutine initialize_ice_thickness
60 subroutine initialize_ice_thickness_from_file(h_shelf, area_shelf_h, hmask, G, US, PF)
62 real,
dimension(SZDI_(G),SZDJ_(G)), &
63 intent(inout) :: h_shelf
64 real,
dimension(SZDI_(G),SZDJ_(G)), &
65 intent(inout) :: area_shelf_h
66 real,
dimension(SZDI_(G),SZDJ_(G)), &
67 intent(inout) :: hmask
74 character(len=200) :: filename,thickness_file,inputdir
75 character(len=200) :: thickness_varname, area_varname
76 character(len=40) :: mdl =
"initialize_ice_thickness_from_file"
77 integer :: i, j, isc, jsc, iec, jec
78 real :: len_sidestress, mask, udh
80 call mom_mesg(
" MOM_ice_shelf_init_profile.F90, initialize_thickness_from_file: reading thickness")
82 call get_param(pf, mdl,
"INPUTDIR", inputdir, default=
".")
83 inputdir = slasher(inputdir)
84 call get_param(pf, mdl,
"ICE_THICKNESS_FILE", thickness_file, &
85 "The file from which the bathymetry is read.", &
86 default=
"ice_shelf_h.nc")
87 call get_param(pf, mdl,
"LEN_SIDE_STRESS", len_sidestress, &
88 "position past which shelf sides are stress free.", &
89 default=0.0, units=
"axis_units")
91 filename = trim(inputdir)//trim(thickness_file)
92 call log_param(pf, mdl,
"INPUTDIR/THICKNESS_FILE", filename)
93 call get_param(pf, mdl,
"ICE_THICKNESS_VARNAME", thickness_varname, &
94 "The name of the thickness variable in ICE_THICKNESS_FILE.", &
96 call get_param(pf, mdl,
"ICE_AREA_VARNAME", area_varname, &
97 "The name of the area variable in ICE_THICKNESS_FILE.", &
98 default=
"area_shelf_h")
100 if (.not.
file_exists(filename, g%Domain))
call mom_error(fatal, &
101 " initialize_topography_from_file: Unable to open "//trim(filename))
103 call mom_read_data(filename, trim(thickness_varname), h_shelf, g%Domain, scale=us%m_to_Z)
104 call mom_read_data(filename,trim(area_varname), area_shelf_h, g%Domain, scale=us%m_to_L**2)
110 isc = g%isc ; jsc = g%jsc ; iec = g%iec ; jec = g%jec
118 if ((g%geoLonCv(i,j) > len_sidestress).and. &
119 (len_sidestress > 0.))
then
120 udh = exp(-(g%geoLonCv(i,j)-len_sidestress)/5.0) * h_shelf(i,j)
121 if (udh <= 25.0)
then
123 area_shelf_h(i,j) = 0.0
131 if (area_shelf_h(i,j) >= g%areaT(i,j))
then
133 elseif (area_shelf_h(i,j) == 0.0)
then
135 elseif ((area_shelf_h(i,j) > 0) .and. (area_shelf_h(i,j) <= g%areaT(i,j)))
then
138 call mom_error(fatal,mdl//
" AREA IN CELL OUT OF RANGE")
143 end subroutine initialize_ice_thickness_from_file
146 subroutine initialize_ice_thickness_channel(h_shelf, area_shelf_h, hmask, G, US, PF)
148 real,
dimension(SZDI_(G),SZDJ_(G)), &
149 intent(inout) :: h_shelf
150 real,
dimension(SZDI_(G),SZDJ_(G)), &
151 intent(inout) :: area_shelf_h
152 real,
dimension(SZDI_(G),SZDJ_(G)), &
153 intent(inout) :: hmask
158 character(len=40) :: mdl =
"initialize_ice_shelf_thickness_channel"
159 real :: max_draft, min_draft, flat_shelf_width, c1, slope_pos
160 real :: edge_pos, shelf_slope_scale, Rho_ocean
161 integer :: i, j, jsc, jec, jsd, jed, jedg, nyh, isc, iec, isd, ied
164 jsc = g%jsc ; jec = g%jec ; isc = g%isc ; iec = g%iec
165 jsd = g%jsd ; jed = g%jed ; isd = g%isd ; ied = g%ied
166 nyh = g%domain%njhalo ; jedg = g%domain%njglobal+nyh
169 call mom_mesg(mdl//
": setting thickness")
171 call get_param(pf, mdl,
"SHELF_MAX_DRAFT", max_draft, &
172 units=
"m", default=1.0, scale=us%m_to_Z)
173 call get_param(pf, mdl,
"SHELF_MIN_DRAFT", min_draft, &
174 units=
"m", default=1.0, scale=us%m_to_Z)
175 call get_param(pf, mdl,
"FLAT_SHELF_WIDTH", flat_shelf_width, &
176 units=
"axis_units", default=0.0)
177 call get_param(pf, mdl,
"SHELF_SLOPE_SCALE", shelf_slope_scale, &
178 units=
"axis_units", default=0.0)
179 call get_param(pf, mdl,
"SHELF_EDGE_POS_0", edge_pos, &
180 units=
"axis_units", default=0.0)
188 slope_pos = edge_pos - flat_shelf_width
189 c1 = 0.0 ;
if (shelf_slope_scale > 0.0) c1 = 1.0 / shelf_slope_scale
194 if (((j+j_off) <= jedg) .AND. ((j+j_off) >= nyh+1))
then
198 if ((j >= jsc) .and. (j <= jec))
then
200 if (g%geoLonCu(i-1,j) >= edge_pos)
then
203 area_shelf_h(i,j) = 0.0
207 if (g%geoLonCu(i,j) > edge_pos)
then
208 area_shelf_h(i,j) = g%areaT(i,j) * (edge_pos - g%geoLonCu(i-1,j)) / &
209 (g%geoLonCu(i,j) - g%geoLonCu(i-1,j))
212 area_shelf_h(i,j) = g%areaT(i,j)
216 if (g%geoLonT(i,j) > slope_pos)
then
217 h_shelf(i,j) = min_draft
223 h_shelf(i,j) = (min_draft + &
224 (max_draft - min_draft) * &
225 min(1.0, (c1*(slope_pos - g%geoLonT(i,j)))**2) )
231 if ((i+g%idg_offset) == g%domain%nihalo+1)
then
238 end subroutine initialize_ice_thickness_channel