@@ -436,28 +436,36 @@ subroutine initialize_MOM_generic_tracer(restart, day, G, GV, US, h, tv, param_f
436
436
" If false, use a fixed value for the photoacclimation mixed layer depth within the " // &
437
437
" generic tracer update. This MLD is only used for photoacclimation. This variable should " // &
438
438
" be set to true if using COBALTv3 for the BGC." , default= .false. )
439
- if (.not. CS% mld_pha_calc) then
440
- call get_param(param_file, " MOM" , " PHA_MLD_VAL" , CS% mld_pha_val, &
441
- " The depth of photoacclimation if fixed depth is used [m]." , &
442
- units= ' m' , default= 0.0 , scale= US% m_to_Z)
443
- else
439
+ if (CS% mld_pha_calc) then
444
440
call get_param(param_file, " MOM" , " PHA_MLD_USE_DELTA_RHO" , CS% mld_pha_use_delta_rho, &
445
441
" If true, use a density difference to find the photoacclimation mixed layer depth " // &
446
442
" within the generic tracer update. This MLD is only used for photoacclimation." , default= .false. )
447
- call get_param(param_file, " MOM" , " PHA_MLD_HREF" , CS% mld_pha_href, &
448
- " The reference depth for a density difference based photoacclimation MLD [m]." , &
449
- units= ' m' , default= 0.0 , scale= US% m_to_Z, do_not_log= .not. CS% mld_pha_use_delta_rho)
450
- call get_param(param_file, " MOM" , " PHA_MLD_DRHO" , CS% mld_pha_drho, &
451
- " The density difference for a density difference based photoacclimation MLD [kg m-3]." , &
452
- units= ' kg/m3' , default= 0.03 , scale= US% kg_m3_to_R, do_not_log= .not. CS% mld_pha_use_delta_rho)
453
-
454
443
call get_param(param_file, " MOM" , " PHA_MLD_USE_DELTA_ENG" , CS% mld_pha_use_delta_eng, &
455
444
" If true, use an energy difference to find the photoacclimation mixed layer depth " // &
456
445
" with the generic tracer update. This MLD is only used for photoacclimation." , default= .false. )
457
- call get_param(param_file, " MOM" , " PHA_MLD_DENG" , CS% mld_pha_deng, &
458
- " The energy for an energy difference based photoacclimation MLD." , default= 25.0 , &
459
- units= ' J/m2' ,scale= US% W_m2_to_RZ3_T3* US% s_to_T, do_not_log= .not. CS% mld_pha_use_delta_eng)
460
-
446
+ if (CS% mld_pha_use_delta_rho .and. CS% mld_pha_use_delta_eng) then
447
+ call MOM_error(FATAL, " PHA_MLD_CALC is set to true and PHA_MLD_USE_DELTA_RHO and PHA_MLD_USE_DELTA_ENG " // &
448
+ " are both true. Choose only one option for the calculated photoacclimation MLD!" )
449
+ elseif ((.not. CS% mld_pha_use_delta_rho) .and. (.not. CS% mld_pha_use_delta_eng)) then
450
+ call MOM_error(FATAL, " PHA_MLD_CALC is set to true but PHA_MLD_USE_DELTA_RHO and PHA_MLD_USE_DELTA_ENG " // &
451
+ " are both false. Choose an option for the calculated photoacclimation MLD!" )
452
+ endif
453
+ if (CS% mld_pha_use_delta_rho) then
454
+ call get_param(param_file, " MOM" , " PHA_MLD_HREF" , CS% mld_pha_href, &
455
+ " The reference depth for a density difference based photoacclimation MLD [m]." , &
456
+ units= ' m' , default= 0.0 , scale= US% m_to_Z, do_not_log= .not. CS% mld_pha_use_delta_rho)
457
+ call get_param(param_file, " MOM" , " PHA_MLD_DRHO" , CS% mld_pha_drho, &
458
+ " The density difference for a density difference based photoacclimation MLD [kg m-3]." , &
459
+ units= ' kg/m3' , default= 0.03 , scale= US% kg_m3_to_R, do_not_log= .not. CS% mld_pha_use_delta_rho)
460
+ elseif (CS% mld_pha_use_delta_eng) then
461
+ call get_param(param_file, " MOM" , " PHA_MLD_DENG" , CS% mld_pha_deng, &
462
+ " The energy for an energy difference based photoacclimation MLD." , default= 25.0 , &
463
+ units= ' J/m2' ,scale= US% W_m2_to_RZ3_T3* US% s_to_T, do_not_log= .not. CS% mld_pha_use_delta_eng)
464
+ endif
465
+ else
466
+ call get_param(param_file, " MOM" , " PHA_MLD_VAL" , CS% mld_pha_val, &
467
+ " The depth of photoacclimation if fixed depth is used [m]." , &
468
+ units= ' m' , default= 0.0 , scale= US% m_to_Z)
461
469
endif
462
470
463
471
0 commit comments