@@ -31,7 +31,7 @@ module MOM_cap_mod
3131use MOM_grid, only: ocean_grid_type, get_global_grid_size
3232use MOM_ocean_model_nuopc, only: ice_ocean_boundary_type
3333use MOM_ocean_model_nuopc, only: ocean_model_restart, ocean_public_type, ocean_state_type
34- use MOM_ocean_model_nuopc, only: ocean_model_init_sfc
34+ use MOM_ocean_model_nuopc, only: ocean_model_init_sfc, ocean_model_flux_init
3535use MOM_ocean_model_nuopc, only: ocean_model_init, update_ocean_model, ocean_model_end
3636use MOM_ocean_model_nuopc, only: get_ocean_grid, get_eps_omesh, query_ocean_state
3737use MOM_cap_time, only: AlarmInit
@@ -422,6 +422,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
422422 logical :: isPresent, isPresentDiro, isPresentLogfile, isSet
423423 logical :: existflag
424424 logical :: use_waves ! If true, the wave modules are active.
425+ character (len= 40 ) :: wave_method ! Wave coupling method.
425426 integer :: userRc
426427 integer :: localPet
427428 integer :: localPeCount
@@ -650,6 +651,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
650651 ocean_public% is_ocean_pe = .true.
651652 call ocean_model_init(ocean_public, ocean_state, time0, time_start, input_restart_file= trim (restartfiles))
652653
654+ ! GMM, this call is not needed for NCAR. Check with EMC.
655+ ! If this can be deleted, perhaps we should also delete ocean_model_flux_init
656+ call ocean_model_flux_init(ocean_state)
657+
653658 call ocean_model_init_sfc(ocean_state, ocean_public)
654659
655660 call mpp_get_compute_domain(ocean_public% domain, isc, iec, jsc, jec)
@@ -669,6 +674,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
669674 Ice_ocean_boundary% seaice_melt_heat (isc:iec,jsc:jec),&
670675 Ice_ocean_boundary% seaice_melt (isc:iec,jsc:jec), &
671676 Ice_ocean_boundary% mi (isc:iec,jsc:jec), &
677+ Ice_ocean_boundary% ice_fraction (isc:iec,jsc:jec), &
678+ Ice_ocean_boundary% u10_sqr (isc:iec,jsc:jec), &
672679 Ice_ocean_boundary% p (isc:iec,jsc:jec), &
673680 Ice_ocean_boundary% lrunoff_hflx (isc:iec,jsc:jec), &
674681 Ice_ocean_boundary% frunoff_hflx (isc:iec,jsc:jec), &
@@ -690,25 +697,32 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
690697 Ice_ocean_boundary% seaice_melt = 0.0
691698 Ice_ocean_boundary% seaice_melt_heat= 0.0
692699 Ice_ocean_boundary% mi = 0.0
700+ Ice_ocean_boundary% ice_fraction = 0.0
701+ Ice_ocean_boundary% u10_sqr = 0.0
693702 Ice_ocean_boundary% p = 0.0
694703 Ice_ocean_boundary% lrunoff_hflx = 0.0
695704 Ice_ocean_boundary% frunoff_hflx = 0.0
696705 Ice_ocean_boundary% lrunoff = 0.0
697706 Ice_ocean_boundary% frunoff = 0.0
698707
699- call query_ocean_state(ocean_state, use_waves= use_waves)
708+ call query_ocean_state(ocean_state, use_waves= use_waves, wave_method = wave_method )
700709 if (use_waves) then
701710 call query_ocean_state(ocean_state, NumWaveBands= Ice_ocean_boundary% num_stk_bands)
702- allocate ( Ice_ocean_boundary% ustk0 (isc:iec,jsc:jec), &
703- Ice_ocean_boundary% vstk0 (isc:iec,jsc:jec), &
704- Ice_ocean_boundary% ustkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
705- Ice_ocean_boundary% vstkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
706- Ice_ocean_boundary% stk_wavenumbers (Ice_ocean_boundary% num_stk_bands))
707- Ice_ocean_boundary% ustk0 = 0.0
708- Ice_ocean_boundary% vstk0 = 0.0
709- call query_ocean_state(ocean_state, WaveNumbers= Ice_ocean_boundary% stk_wavenumbers, unscale= .true. )
710- Ice_ocean_boundary% ustkb = 0.0
711- Ice_ocean_boundary% vstkb = 0.0
711+ if (wave_method == " EFACTOR" ) then
712+ allocate ( Ice_ocean_boundary% lamult(isc:iec,jsc:jec) )
713+ Ice_ocean_boundary% lamult = 0.0
714+ else
715+ allocate ( Ice_ocean_boundary% ustk0 (isc:iec,jsc:jec), &
716+ Ice_ocean_boundary% vstk0 (isc:iec,jsc:jec), &
717+ Ice_ocean_boundary% ustkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
718+ Ice_ocean_boundary% vstkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
719+ Ice_ocean_boundary% stk_wavenumbers (Ice_ocean_boundary% num_stk_bands))
720+ Ice_ocean_boundary% ustk0 = 0.0
721+ Ice_ocean_boundary% vstk0 = 0.0
722+ call query_ocean_state(ocean_state, WaveNumbers= Ice_ocean_boundary% stk_wavenumbers, unscale= .true. )
723+ Ice_ocean_boundary% ustkb = 0.0
724+ Ice_ocean_boundary% vstkb = 0.0
725+ endif
712726 endif
713727 ! Consider adding this:
714728 ! if (.not.use_waves) Ice_ocean_boundary%num_stk_bands = 0
@@ -722,18 +736,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
722736 call fld_list_add(fldsFrOcn_num, fldsFrOcn, trim (scalar_field_name), " will_provide" )
723737 end if
724738
725- if (cesm_coupled) then
726- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_lamult" , "will provide")
727- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_ustokes" , "will provide")
728- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_vstokes" , "will provide")
729- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_hstokes" , "will provide")
730- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Fioi_melth" , "will provide")
731- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Fioi_meltw" , "will provide")
732- ! call fld_list_add(fldsFrOcn_num, fldsFrOcn, "So_fswpen" , "will provide")
733- else
734- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "mass_of_overlying_sea_ice" , "will provide")
735- ! call fld_list_add(fldsFrOcn_num, fldsFrOcn, "sea_lev" , "will provide")
736- endif
737739
738740 !- -------- import fields -------------
739741 call fld_list_add(fldsToOcn_num, fldsToOcn, " mean_salt_rate" , " will provide" ) ! from ice
@@ -751,21 +753,27 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
751753 call fld_list_add(fldsToOcn_num, fldsToOcn, " inst_pres_height_surface" , " will provide" )
752754 call fld_list_add(fldsToOcn_num, fldsToOcn, " Foxx_rofl" , " will provide" ) !- > liquid runoff
753755 call fld_list_add(fldsToOcn_num, fldsToOcn, " Foxx_rofi" , " will provide" ) !- > ice runoff
756+ call fld_list_add(fldsToOcn_num, fldsToOcn, " Si_ifrac" , " will provide" ) !- > ice fraction
757+ call fld_list_add(fldsToOcn_num, fldsToOcn, " So_duu10n" , " will provide" ) !- > wind^2 at 10m
754758 call fld_list_add(fldsToOcn_num, fldsToOcn, " mean_fresh_water_to_ocean_rate" , " will provide" )
755759 call fld_list_add(fldsToOcn_num, fldsToOcn, " net_heat_flx_to_ocn" , " will provide" )
756760 ! These are not currently used and changing requires a nuopc dictionary change
757761 ! call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide")
758762 ! call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide")
759763 if (use_waves) then
760- if (Ice_ocean_boundary% num_stk_bands > 3 ) then
761- call MOM_error(FATAL, " Number of Stokes Bands > 3, NUOPC cap not set up for this" )
764+ if (wave_method == " EFACTOR" ) then
765+ call fld_list_add(fldsToOcn_num, fldsToOcn, " Sw_lamult" , " will provide" )
766+ else
767+ if (Ice_ocean_boundary% num_stk_bands > 3 ) then
768+ call MOM_error(FATAL, " Number of Stokes Bands > 3, NUOPC cap not set up for this" )
769+ endif
770+ call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_1" , " will provide" )
771+ call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_1" , " will provide" )
772+ call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_2" , " will provide" )
773+ call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_2" , " will provide" )
774+ call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_3" , " will provide" )
775+ call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_3" , " will provide" )
762776 endif
763- call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_1" , " will provide" )
764- call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_1" , " will provide" )
765- call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_2" , " will provide" )
766- call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_2" , " will provide" )
767- call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_3" , " will provide" )
768- call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_3" , " will provide" )
769777 endif
770778
771779 !- -------- export fields -------------
@@ -1103,7 +1111,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
11031111 k = k + 1 ! Increment position within gindex
11041112 if (mask(k) /= 0 ) then
11051113 mesh_areas(k) = dataPtr_mesh_areas(k)
1106- model_areas(k) = ocean_grid% AreaT(i,j) / ocean_grid% Rad_Earth** 2
1114+ model_areas(k) = ocean_grid% US % L_to_m ** 2 * ocean_grid % AreaT(i,j) / ocean_grid% Rad_Earth** 2
11071115 mod2med_areacor(k) = model_areas(k) / mesh_areas(k)
11081116 med2mod_areacor(k) = mesh_areas(k) / model_areas(k)
11091117 end if
0 commit comments