@@ -3241,18 +3241,21 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3241
3241
3242
3242
! This subroutine is used to allocate and register any fields in this module
3243
3243
! that should be written to or read from the restart file.
3244
+ logical :: non_Bous ! If true, this run is fully non-Boussinesq
3245
+ logical :: Boussinesq ! If true, this run is fully Boussinesq
3246
+ logical :: semi_Boussinesq ! If true, this run is partially non-Boussinesq
3244
3247
logical :: use_int_tides
3245
3248
integer :: num_freq, num_angle , num_mode, period_1
3246
3249
integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB, i, j, a, fr
3247
- character (64 ) :: var_name, cfr
3250
+ character (64 ) :: var_name, cfr, units
3248
3251
3249
3252
type (axis_info) :: axes_inttides(2 )
3250
3253
real , dimension (:), allocatable :: angles, freqs ! Lables for angles and frequencies [nondim]
3251
3254
real :: HZ2_T2_to_J_m2 ! unit conversion factor for Energy from internal to mks [H Z2 T-2 ~> m3 s-2 or J m-2]
3252
3255
3253
3256
isd = G% isd ; ied = G% ied ; jsd = G% jsd ; jed = G% jed
3254
3257
3255
- HZ2_T2_to_J_m2 = GV% H_to_kg_m2 * (US% Z_to_m** 2 )* (US% s_to_T** 2 )
3258
+ HZ2_T2_to_J_m2 = GV% H_to_MKS * (US% Z_to_m** 2 )* (US% s_to_T** 2 )
3256
3259
3257
3260
if (associated (CS)) then
3258
3261
call MOM_error(WARNING, " register_int_tide_restarts called " // &
@@ -3267,6 +3270,19 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3267
3270
call get_param(param_file, " MOM" , " INTERNAL_TIDE_FREQS" , num_freq, default= 1 )
3268
3271
call get_param(param_file, " MOM" , " INTERNAL_TIDE_MODES" , num_mode, default= 1 )
3269
3272
3273
+ ! define restart units depemding on Boussinesq
3274
+ call get_param(param_file, " MOM" , " BOUSSINESQ" , Boussinesq, &
3275
+ " If true, make the Boussinesq approximation." , default= .true. , do_not_log= .true. )
3276
+ call get_param(param_file, " MOM" , " SEMI_BOUSSINESQ" , semi_Boussinesq, &
3277
+ " If true, do non-Boussinesq pressure force calculations and use mass-based " // &
3278
+ " thicknesses, but use RHO_0 to convert layer thicknesses into certain " // &
3279
+ " height changes. This only applies if BOUSSINESQ is false." , &
3280
+ default= .true. , do_not_log= .true. )
3281
+ non_Bous = .not. (Boussinesq .or. semi_Boussinesq)
3282
+
3283
+ units= " J m-2"
3284
+ if (non_Bous) units= " m3 s-2"
3285
+
3270
3286
allocate (angles(num_angle))
3271
3287
allocate (freqs(num_freq))
3272
3288
@@ -3293,7 +3309,7 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3293
3309
! register all 4d restarts and copy into full Energy array when restarting from previous state
3294
3310
call register_restart_field(CS% En_restart_mode1(:,:,:,:), " IW_energy_mode1" , .false. , restart_CS, &
3295
3311
longname= " The internal wave energy density f(i,j,angle,freq) for mode 1" , &
3296
- units= " J m-2 " , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3312
+ units= units , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3297
3313
extra_axes= axes_inttides)
3298
3314
3299
3315
do fr= 1 ,num_freq ; do a= 1 ,num_angle ; do j= jsd,jed ; do i= isd,ied
@@ -3303,7 +3319,7 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3303
3319
if (num_mode >= 2 ) then
3304
3320
call register_restart_field(CS% En_restart_mode2(:,:,:,:), " IW_energy_mode2" , .false. , restart_CS, &
3305
3321
longname= " The internal wave energy density f(i,j,angle,freq) for mode 2" , &
3306
- units= " J m-2 " , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3322
+ units= units , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3307
3323
extra_axes= axes_inttides)
3308
3324
3309
3325
do fr= 1 ,num_freq ; do a= 1 ,num_angle ; do j= jsd,jed ; do i= isd,ied
@@ -3315,7 +3331,7 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3315
3331
if (num_mode >= 3 ) then
3316
3332
call register_restart_field(CS% En_restart_mode3(:,:,:,:), " IW_energy_mode3" , .false. , restart_CS, &
3317
3333
longname= " The internal wave energy density f(i,j,angle,freq) for mode 3" , &
3318
- units= " J m-2 " , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3334
+ units= units , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3319
3335
extra_axes= axes_inttides)
3320
3336
3321
3337
do fr= 1 ,num_freq ; do a= 1 ,num_angle ; do j= jsd,jed ; do i= isd,ied
@@ -3327,7 +3343,7 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3327
3343
if (num_mode >= 4 ) then
3328
3344
call register_restart_field(CS% En_restart_mode4(:,:,:,:), " IW_energy_mode4" , .false. , restart_CS, &
3329
3345
longname= " The internal wave energy density f(i,j,angle,freq) for mode 4" , &
3330
- units= " J m-2 " , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3346
+ units= units , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3331
3347
extra_axes= axes_inttides)
3332
3348
3333
3349
do fr= 1 ,num_freq ; do a= 1 ,num_angle ; do j= jsd,jed ; do i= isd,ied
@@ -3339,7 +3355,7 @@ subroutine register_int_tide_restarts(G, GV, US, param_file, CS, restart_CS)
3339
3355
if (num_mode >= 5 ) then
3340
3356
call register_restart_field(CS% En_restart_mode5(:,:,:,:), " IW_energy_mode5" , .false. , restart_CS, &
3341
3357
longname= " The internal wave energy density f(i,j,angle,freq) for mode 5" , &
3342
- units= " J m-2 " , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3358
+ units= units , conversion= HZ2_T2_to_J_m2, z_grid= ' 1' , t_grid= " s" , &
3343
3359
extra_axes= axes_inttides)
3344
3360
3345
3361
do fr= 1 ,num_freq ; do a= 1 ,num_angle ; do j= jsd,jed ; do i= isd,ied
0 commit comments