@@ -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
@@ -424,6 +424,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
424424 logical :: isPresent, isPresentDiro, isPresentLogfile, isSet
425425 logical :: existflag
426426 logical :: use_waves ! If true, the wave modules are active.
427+ character (len= 40 ) :: wave_method ! Wave coupling method.
427428 integer :: userRc
428429 integer :: localPet
429430 integer :: localPeCount
@@ -652,6 +653,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
652653 ocean_public% is_ocean_pe = .true.
653654 call ocean_model_init(ocean_public, ocean_state, time0, time_start, input_restart_file= trim (restartfiles))
654655
656+ ! GMM, this call is not needed for NCAR. Check with EMC.
657+ ! If this can be deleted, perhaps we should also delete ocean_model_flux_init
658+ call ocean_model_flux_init(ocean_state)
659+
655660 call ocean_model_init_sfc(ocean_state, ocean_public)
656661
657662 call mpp_get_compute_domain(ocean_public% domain, isc, iec, jsc, jec)
@@ -671,6 +676,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
671676 Ice_ocean_boundary% seaice_melt_heat (isc:iec,jsc:jec),&
672677 Ice_ocean_boundary% seaice_melt (isc:iec,jsc:jec), &
673678 Ice_ocean_boundary% mi (isc:iec,jsc:jec), &
679+ Ice_ocean_boundary% ice_fraction (isc:iec,jsc:jec), &
680+ Ice_ocean_boundary% u10_sqr (isc:iec,jsc:jec), &
674681 Ice_ocean_boundary% p (isc:iec,jsc:jec), &
675682 Ice_ocean_boundary% lrunoff_hflx (isc:iec,jsc:jec), &
676683 Ice_ocean_boundary% frunoff_hflx (isc:iec,jsc:jec), &
@@ -692,25 +699,32 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
692699 Ice_ocean_boundary% seaice_melt = 0.0
693700 Ice_ocean_boundary% seaice_melt_heat= 0.0
694701 Ice_ocean_boundary% mi = 0.0
702+ Ice_ocean_boundary% ice_fraction = 0.0
703+ Ice_ocean_boundary% u10_sqr = 0.0
695704 Ice_ocean_boundary% p = 0.0
696705 Ice_ocean_boundary% lrunoff_hflx = 0.0
697706 Ice_ocean_boundary% frunoff_hflx = 0.0
698707 Ice_ocean_boundary% lrunoff = 0.0
699708 Ice_ocean_boundary% frunoff = 0.0
700709
701- call query_ocean_state(ocean_state, use_waves= use_waves)
710+ call query_ocean_state(ocean_state, use_waves= use_waves, wave_method = wave_method )
702711 if (use_waves) then
703712 call query_ocean_state(ocean_state, NumWaveBands= Ice_ocean_boundary% num_stk_bands)
704- allocate ( Ice_ocean_boundary% ustk0 (isc:iec,jsc:jec), &
705- Ice_ocean_boundary% vstk0 (isc:iec,jsc:jec), &
706- Ice_ocean_boundary% ustkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
707- Ice_ocean_boundary% vstkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
708- Ice_ocean_boundary% stk_wavenumbers (Ice_ocean_boundary% num_stk_bands))
709- Ice_ocean_boundary% ustk0 = 0.0
710- Ice_ocean_boundary% vstk0 = 0.0
711- call query_ocean_state(ocean_state, WaveNumbers= Ice_ocean_boundary% stk_wavenumbers, unscale= .true. )
712- Ice_ocean_boundary% ustkb = 0.0
713- Ice_ocean_boundary% vstkb = 0.0
713+ if (wave_method == " EFACTOR" ) then
714+ allocate ( Ice_ocean_boundary% lamult(isc:iec,jsc:jec) )
715+ Ice_ocean_boundary% lamult = 0.0
716+ else
717+ allocate ( Ice_ocean_boundary% ustk0 (isc:iec,jsc:jec), &
718+ Ice_ocean_boundary% vstk0 (isc:iec,jsc:jec), &
719+ Ice_ocean_boundary% ustkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
720+ Ice_ocean_boundary% vstkb (isc:iec,jsc:jec,Ice_ocean_boundary% num_stk_bands), &
721+ Ice_ocean_boundary% stk_wavenumbers (Ice_ocean_boundary% num_stk_bands))
722+ Ice_ocean_boundary% ustk0 = 0.0
723+ Ice_ocean_boundary% vstk0 = 0.0
724+ call query_ocean_state(ocean_state, WaveNumbers= Ice_ocean_boundary% stk_wavenumbers, unscale= .true. )
725+ Ice_ocean_boundary% ustkb = 0.0
726+ Ice_ocean_boundary% vstkb = 0.0
727+ endif
714728 endif
715729 ! Consider adding this:
716730 ! if (.not.use_waves) Ice_ocean_boundary%num_stk_bands = 0
@@ -724,18 +738,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
724738 call fld_list_add(fldsFrOcn_num, fldsFrOcn, trim (scalar_field_name), " will_provide" )
725739 end if
726740
727- if (cesm_coupled) then
728- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_lamult" , "will provide")
729- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_ustokes" , "will provide")
730- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_vstokes" , "will provide")
731- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Sw_hstokes" , "will provide")
732- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Fioi_melth" , "will provide")
733- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "Fioi_meltw" , "will provide")
734- ! call fld_list_add(fldsFrOcn_num, fldsFrOcn, "So_fswpen" , "will provide")
735- else
736- ! call fld_list_add(fldsToOcn_num, fldsToOcn, "mass_of_overlying_sea_ice" , "will provide")
737- ! call fld_list_add(fldsFrOcn_num, fldsFrOcn, "sea_lev" , "will provide")
738- endif
739741
740742 !- -------- import fields -------------
741743 call fld_list_add(fldsToOcn_num, fldsToOcn, " mean_salt_rate" , " will provide" ) ! from ice
@@ -753,21 +755,27 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
753755 call fld_list_add(fldsToOcn_num, fldsToOcn, " inst_pres_height_surface" , " will provide" )
754756 call fld_list_add(fldsToOcn_num, fldsToOcn, " Foxx_rofl" , " will provide" ) !- > liquid runoff
755757 call fld_list_add(fldsToOcn_num, fldsToOcn, " Foxx_rofi" , " will provide" ) !- > ice runoff
758+ call fld_list_add(fldsToOcn_num, fldsToOcn, " Si_ifrac" , " will provide" ) !- > ice fraction
759+ call fld_list_add(fldsToOcn_num, fldsToOcn, " So_duu10n" , " will provide" ) !- > wind^2 at 10m
756760 call fld_list_add(fldsToOcn_num, fldsToOcn, " mean_fresh_water_to_ocean_rate" , " will provide" )
757761 call fld_list_add(fldsToOcn_num, fldsToOcn, " net_heat_flx_to_ocn" , " will provide" )
758762 ! These are not currently used and changing requires a nuopc dictionary change
759763 ! call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide")
760764 ! call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide")
761765 if (use_waves) then
762- if (Ice_ocean_boundary% num_stk_bands > 3 ) then
763- call MOM_error(FATAL, " Number of Stokes Bands > 3, NUOPC cap not set up for this" )
766+ if (wave_method == " EFACTOR" ) then
767+ call fld_list_add(fldsToOcn_num, fldsToOcn, " Sw_lamult" , " will provide" )
768+ else
769+ if (Ice_ocean_boundary% num_stk_bands > 3 ) then
770+ call MOM_error(FATAL, " Number of Stokes Bands > 3, NUOPC cap not set up for this" )
771+ endif
772+ call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_1" , " will provide" )
773+ call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_1" , " will provide" )
774+ call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_2" , " will provide" )
775+ call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_2" , " will provide" )
776+ call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_3" , " will provide" )
777+ call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_3" , " will provide" )
764778 endif
765- call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_1" , " will provide" )
766- call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_1" , " will provide" )
767- call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_2" , " will provide" )
768- call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_2" , " will provide" )
769- call fld_list_add(fldsToOcn_num, fldsToOcn, " eastward_partitioned_stokes_drift_3" , " will provide" )
770- call fld_list_add(fldsToOcn_num, fldsToOcn, " northward_partitioned_stokes_drift_3" , " will provide" )
771779 endif
772780
773781 !- -------- export fields -------------
@@ -1105,7 +1113,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
11051113 k = k + 1 ! Increment position within gindex
11061114 if (mask(k) /= 0 ) then
11071115 mesh_areas(k) = dataPtr_mesh_areas(k)
1108- model_areas(k) = ocean_grid% AreaT(i,j) / ocean_grid% Rad_Earth** 2
1116+ model_areas(k) = ocean_grid% US % L_to_m ** 2 * ocean_grid % AreaT(i,j) / ocean_grid% Rad_Earth** 2
11091117 mod2med_areacor(k) = model_areas(k) / mesh_areas(k)
11101118 med2mod_areacor(k) = mesh_areas(k) / model_areas(k)
11111119 end if
0 commit comments