- Timestamp:
- May 31, 2024, 7:16:42 PM (7 months ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/changelog.txt
r3342 r3352 1945 1945 Adapts the Thermal Plume Model for generic tracers. 1946 1946 Adds variables such as vteta in writediagfi section. 1947 1948 == 31/05/2024 == EM 1949 Updates for the Slab ocean: 1950 - ensure that surface heat capacity "capcal" at first call matches what it 1951 was at last call of previous run. Also ensure that "ocean slab" variables 1952 put in restartfi.nc are correct. 1953 - adapt "ocean_slab_get_vars" routine to also return sea ice temperature 1954 - add some missing OpenMP THREADPRIVATE on saved variables in ocean_slab_mod. -
trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90
r3291 r3352 106 106 REAL, PARAMETER :: ice_cond=2.17*ice_den !conductivity of ice [in W/(m.K) or (W.kg)/(K.m4)] 107 107 REAL, PRIVATE, SAVE :: sno_cond ! conductivity of snow [in W/(m.K) or (W.kg)/(K.m4)] 108 !$OMP THREADPRIVATE(sno_cond) 108 109 REAL, PARAMETER :: ice_cap=2067. ! specific heat capacity, snow and ice [in J/(kg.K)] 109 110 REAL, PARAMETER :: sea_cap=3994. ! specific heat capacity, seawater [in J/(kg.K)] … … 116 117 REAL, PARAMETER :: ice_frac_min=0.001 117 118 REAL, PRIVATE, SAVE :: ice_frac_max ! Max ice fraction (leads) 119 !$OMP THREADPRIVATE(ice_frac_max) 118 120 REAL, PARAMETER :: h_ice_min=0.01*ice_den ! min ice thickness [in kg/m2] 119 121 REAL, PARAMETER :: h_ice_thin=0.15*ice_den ! thin ice thickness [in kg/m2] … … 121 123 ! ice_thin is also height of new ice 122 124 REAL, PRIVATE, SAVE :: h_ice_thick ! thin ice thickness 125 !$OMP THREADPRIVATE(h_ice_thick) 123 126 ! above ice_thick, priority is melt height / grow lateral 124 127 REAL, PARAMETER :: h_ice_new=1.*ice_den ! max height of new open ocean ice [in kg/m2] … … 1049 1052 ! ------ End Albedo ---------- 1050 1053 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))) 1053 1057 tslab(:,1)=tslab(:,1)-fsic*seaice*ice_lat*cyang 1054 1058 tice=t_melt … … 1085 1089 !**************************************************************************************** 1086 1090 ! 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) 1089 1093 1090 1094 ! "Get some variables from module ocean_slab_mod" … … 1092 1096 INTEGER, INTENT(IN) :: ngrid 1093 1097 REAL, DIMENSION(ngrid,nslay), INTENT(OUT) :: tslab_loc 1098 REAL, INTENT(OUT) :: tice_loc(ngrid) 1094 1099 REAL, DIMENSION(ngrid), INTENT(OUT) :: seaice_loc 1095 1100 REAL, DIMENSION(ngrid), INTENT(OUT) :: flux_g_loc … … 1100 1105 1101 1106 ! 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(:) 1103 1111 dt_hdiff_loc(:,:)=0. 1104 1112 dt_ekman_loc(:,:)=0. 1105 tslab_loc(:,:) = tslab(:,:)1106 seaice_loc(:) = seaice(:)1107 flux_g_loc(:) = slab_bilg(:)1108 1113 1109 1114 !! 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 666 666 667 667 !! 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 669 672 endif ! end of 'ok_slab_ocean'. 670 673 … … 678 681 679 682 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 691 702 endif ! end of 'ok_slab_ocean'. 692 703 … … 1979 1990 call ocean_slab_frac(pctsrf_sic, zmasq) 1980 1991 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, & 1982 1993 dt_hdiff, dt_ekman) 1983 1994 … … 2374 2385 if (ngrid.ne.1) then 2375 2386 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) 2376 2391 2377 2392 call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
Note: See TracChangeset
for help on using the changeset viewer.