Ignore:
Timestamp:
May 31, 2024, 7:16:42 PM (7 months ago)
Author:
emillour
Message:

Generic PCM:
Updates for the Slab ocean:

  • ensure that surface heat capacity "capcal" at first call matches what it was at last call of previous run. Also ensure that "ocean slab" variables put in restartfi.nc are correct.
  • adapt "ocean_slab_get_vars" routine to also return sea ice temperature
  • add some missing OpenMP THREADPRIVATE on saved variables in ocean_slab_mod.

EM

Location:
trunk/LMDZ.GENERIC/libf/phystd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90

    r3291 r3352  
    106106    REAL, PARAMETER :: ice_cond=2.17*ice_den !conductivity of ice [in W/(m.K) or (W.kg)/(K.m4)]
    107107    REAL, PRIVATE, SAVE :: sno_cond ! conductivity of snow [in W/(m.K) or (W.kg)/(K.m4)]
     108!$OMP THREADPRIVATE(sno_cond)
    108109    REAL, PARAMETER :: ice_cap=2067.   ! specific heat capacity, snow and ice [in J/(kg.K)]
    109110    REAL, PARAMETER :: sea_cap=3994.   ! specific heat capacity, seawater [in J/(kg.K)]
     
    116117    REAL, PARAMETER :: ice_frac_min=0.001
    117118    REAL, PRIVATE, SAVE :: ice_frac_max ! Max ice fraction (leads)
     119!$OMP THREADPRIVATE(ice_frac_max)
    118120    REAL, PARAMETER :: h_ice_min=0.01*ice_den ! min ice thickness [in kg/m2]
    119121    REAL, PARAMETER :: h_ice_thin=0.15*ice_den ! thin ice thickness [in kg/m2]
     
    121123    ! ice_thin is also height of new ice
    122124    REAL, PRIVATE, SAVE :: h_ice_thick ! thin ice thickness
     125!$OMP THREADPRIVATE(h_ice_thick)
    123126    ! above ice_thick, priority is melt height / grow lateral
    124127    REAL, PARAMETER :: h_ice_new=1.*ice_den ! max height of new open ocean ice [in kg/m2]
     
    10491052! ------ End Albedo ----------
    10501053
    1051     !tests remaining ice fraction
    1052     WHERE ((fsic.LT.ice_frac_min).OR.(seaice.LT.h_ice_min))
     1054    !tests remaining ice fraction (on ocean grid points)
     1055    WHERE ((zmasq==0).and. &
     1056           ((fsic.LT.ice_frac_min).OR.(seaice.LT.h_ice_min)))
    10531057        tslab(:,1)=tslab(:,1)-fsic*seaice*ice_lat*cyang
    10541058        tice=t_melt
     
    10851089!****************************************************************************************
    10861090!
    1087   SUBROUTINE ocean_slab_get_vars(ngrid,tslab_loc, seaice_loc, flux_g_loc, &
    1088        dt_hdiff_loc,dt_ekman_loc)
     1091  SUBROUTINE ocean_slab_get_vars(ngrid, tslab_loc, tice_loc, seaice_loc, &
     1092                                 flux_g_loc, dt_hdiff_loc,dt_ekman_loc)
    10891093
    10901094! "Get some variables from module ocean_slab_mod"
     
    10921096    INTEGER, INTENT(IN)                     :: ngrid
    10931097    REAL, DIMENSION(ngrid,nslay), INTENT(OUT) :: tslab_loc
     1098    REAL, INTENT(OUT) :: tice_loc(ngrid)
    10941099    REAL, DIMENSION(ngrid), INTENT(OUT) :: seaice_loc
    10951100    REAL, DIMENSION(ngrid), INTENT(OUT) :: flux_g_loc
     
    11001105
    11011106! Set the output variables
    1102     tslab_loc(:,:) = 0.
     1107    tslab_loc(:,:) = tslab(:,:)
     1108    tice_loc(:)=tice(:)
     1109    seaice_loc(:) = seaice(:)
     1110    flux_g_loc(:) = slab_bilg(:)
    11031111    dt_hdiff_loc(:,:)=0.
    11041112    dt_ekman_loc(:,:)=0.
    1105     tslab_loc(:,:) = tslab(:,:)
    1106     seaice_loc(:) = seaice(:)
    1107     flux_g_loc(:) = slab_bilg(:)
    11081113
    11091114!!      dt_hdiff_loc(:,i) = dt_hdiff(:,i)*slabh(i)*1000.*4228. !Convert en W/m2
  • trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90

    r3342 r3352  
    666666
    667667!!           CALL init_masquv(ngrid,zmasq)
    668 
     668           ! ensure that "slab" variables match "physiq" ones
     669           call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
     670                      dt_hdiff, dt_ekman)
     671           
    669672         endif ! end of 'ok_slab_ocean'.
    670673
     
    678681
    679682            if (ok_slab_ocean) then
    680                do ig=1,ngrid
    681                   if (nint(rnat(ig)).eq.2) then
    682                      capcal(ig)=capcalocean
    683                      if (pctsrf_sic(ig).gt.0.5) then
    684                         capcal(ig)=capcalseaice
    685                         if (qsurf(ig,igcm_h2o_ice).gt.0.) then
    686                            capcal(ig)=capcalsno
    687                         endif
    688                      endif
    689                   endif
    690                enddo
     683              ! mimic what is done during a regular time step
     684              do ig=1,ngrid
     685                fluxgrdocean(ig)=fluxgrd(ig)
     686                if (nint(rnat(ig)).eq.0) then
     687                  capcal(ig)=capcalocean
     688                  fluxgrd(ig)=0.
     689                  ! Dividing by cell area to have flux in W/m2
     690                  fluxgrdocean(ig)=flux_g(ig)+(1-pctsrf_sic(ig))*(dt_hdiff(ig,1)+dt_ekman(ig,1))/cell_area(ig)
     691                  do iq=1,nsoilmx
     692                    tsoil(ig,iq)=tsurf(ig)
     693                  enddo
     694                  if (pctsrf_sic(ig).gt.0.5) then
     695                    capcal(ig)=capcalseaice
     696                    if (qsurf(ig,igcm_h2o_ice).gt.0.) then
     697                      capcal(ig)=capcalsno
     698                    endif
     699                  endif ! of if (pctsrf_sic(ig).gt.0.5)
     700                endif ! of if (nint(rnat(ig)).eq.0)
     701              enddo ! of do ig=1,ngrid
    691702            endif ! end of 'ok_slab_ocean'.
    692703
     
    19791990            call ocean_slab_frac(pctsrf_sic, zmasq)
    19801991
    1981             call ocean_slab_get_vars(ngrid, tslab, sea_ice, flux_g, &
     1992            call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
    19821993                      dt_hdiff, dt_ekman)
    19831994                     
     
    23742385         if (ngrid.ne.1) then
    23752386            write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
     2387           
     2388            ! fetch "ocean variables" to ensure they are stored
     2389            call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
     2390                                     dt_hdiff, dt_ekman)
    23762391
    23772392            call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
Note: See TracChangeset for help on using the changeset viewer.