Changeset 1297
- Timestamp:
- Jun 18, 2014, 4:33:56 AM (11 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/callkeys.h
r1216 r1297 26 26 & , hydrology, sourceevol & 27 27 & , CLFvarying & 28 & , strictboundcorrk 28 & , strictboundcorrk & 29 & , ok_slab_ocean & 30 & , ok_slab_sic & 31 & , ok_slab_heat_transp 32 29 33 30 34 COMMON/callkeys_i/iaervar,iddist,iradia,startype … … 73 77 logical nosurf 74 78 logical oblate 79 logical ok_slab_ocean 80 logical ok_slab_sic 81 logical ok_slab_heat_transp 75 82 76 83 integer iddist -
trunk/LMDZ.GENERIC/libf/phystd/comsoil_h.F90
r1216 r1297 5 5 !integer, parameter :: nsoilmx = 18 ! for z1=0.0002 m, depth = 18 m => mars case 6 6 !integer, parameter :: nsoilmx = 13 ! for z1=0.03 m, depth = 104.8 m => earth case 7 integer, parameter :: nsoilmx = 18 7 integer, parameter :: nsoilmx = 18 8 8 9 9 real,save,allocatable,dimension(:) :: layer ! soil layer depths -
trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90
r965 r1297 1 1 subroutine hydrol(ngrid,nq,ptimestep,rnat,tsurf, & 2 2 qsurf,dqsurf,dqs_hyd,pcapcal, & 3 albedo0,albedo,mu0,pdtsurf,pdtsurf_hyd,hice) 3 albedo0,albedo,mu0,pdtsurf,pdtsurf_hyd,hice, & 4 pctsrf_sic,sea_ice) 4 5 5 6 use ioipsl_getincom … … 9 10 USE comgeomfi_h 10 11 USE tracer_h 12 use slab_ice_h 11 13 12 14 implicit none … … 46 48 ! Inputs 47 49 ! ------ 48 real albedoocean49 parameter (albedoocean=0.07)50 50 real albedoice 51 51 save albedoice … … 62 62 ! Arguments 63 63 ! --------- 64 integerrnat(ngrid) ! I changed this to integer (RW)64 real rnat(ngrid) ! I changed this to integer (RW) 65 65 real,dimension(:),allocatable,save :: runoff 66 66 real totalrunoff, tsea, oceanarea … … 73 73 real hice(ngrid) 74 74 real albedo0(ngrid), albedo(ngrid) 75 real pctsrf_sic(ngrid), sea_ice(ngrid) 75 76 76 77 real oceanarea2 … … 91 92 real zqsurf(ngrid,nq) 92 93 real ztsurf(ngrid) 94 real albedo_sic, alb_ice 95 real zfra 93 96 94 97 integer, save :: ivap, iliq, iice … … 134 137 oceanarea=0. 135 138 do ig=1,ngrid 136 if( rnat(ig).eq.0)then139 if(nint(rnat(ig)).eq.0)then 137 140 oceanarea=oceanarea+area(ig) 138 141 endif … … 175 178 ! Ocean 176 179 ! ----- 177 if( rnat(ig).eq.0)then180 if(nint(rnat(ig)).eq.0)then 178 181 179 182 ! re-calculate oceanic albedo 180 if(diurnal.and.oceanalbvary)then 181 fauxo = ( 1.47 - ACOS( mu0(ig) ) )/0.15 ! where does this come from (Benjamin)? 182 albedo(ig) = 1.1*( .03 + .630/( 1. + fauxo*fauxo)) 183 albedo(ig) = MAX(MIN(albedo(ig),0.60),0.04) 184 else 185 albedo(ig) = albedoocean ! modif Benjamin 186 end if 183 ! if(diurnal.and.oceanalbvary)then 184 ! fauxo = ( 1.47 - ACOS( mu0(ig) ) )/0.15 ! where does this come from (Benjamin)? 185 ! albedo(ig) = 1.1*( .03 + .630/( 1. + fauxo*fauxo)) 186 ! albedo(ig) = MAX(MIN(albedo(ig),0.60),0.04) 187 ! else 188 albedo(ig) = alb_ocean ! modif Benjamin 189 ! end if 190 191 192 if(ok_slab_ocean) then 193 194 ! Fraction neige (hauteur critique 45kg/m2~15cm) 195 zfra = MAX(0.0,MIN(1.0,zqsurf(ig,iice)/45.0)) 196 ! Albedo glace 197 alb_ice=alb_ice_max-(alb_ice_max-alb_ice_min) & 198 *exp(-sea_ice(ig)/h_alb_ice) 199 ! Albedo glace+neige 200 albedo_sic= albedosnow*zfra + alb_ice*(1.0-zfra) 201 202 ! Albedo final 203 albedo(ig) = pctsrf_sic(ig)*albedo_sic + (1.-pctsrf_sic(ig))*alb_ocean 204 ! oceanic ice height, just for diagnostics 205 hice(ig) = MIN(10.,sea_ice(ig)/rhowater) 206 else !ok_slab_ocean 207 187 208 188 209 ! calculate oceanic ice height including the latent heat of ice formation … … 214 235 215 236 pdtsurf_hyd(ig) = -hicebis(ig)*RLFTT*rhowater/pcapcal(ig)/ptimestep 216 albedo(ig) = alb edoocean237 albedo(ig) = alb_ocean 217 238 218 239 endif … … 221 242 zqsurf(ig,iice) = hice(ig)*rhowater 222 243 244 endif!(ok_slab_ocean) 245 223 246 224 247 ! Continent 225 248 ! --------- 226 elseif ( rnat(ig).eq.1) then249 elseif (nint(rnat(ig)).eq.1) then 227 250 228 251 ! melt the snow … … 298 321 oceanarea2=0. 299 322 DO ig=1,ngrid 300 if(( rnat(ig).eq.0).and.(hice(ig).eq.0.))then323 if((nint(rnat(ig)).eq.0).and.(hice(ig).eq.0.))then 301 324 oceanarea2=oceanarea2+area(ig)*pcapcal(ig) 302 325 end if … … 305 328 tsea=0. 306 329 DO ig=1,ngrid 307 if(( rnat(ig).eq.0).and.(hice(ig).eq.0.))then330 if((nint(rnat(ig)).eq.0).and.(hice(ig).eq.0.))then 308 331 tsea=tsea+ztsurf(ig)*area(ig)*pcapcal(ig)/oceanarea2 309 332 end if … … 311 334 312 335 DO ig=1,ngrid 313 if(( rnat(ig).eq.0).and.(hice(ig).eq.0))then336 if((nint(rnat(ig)).eq.0).and.(hice(ig).eq.0))then 314 337 pdtsurf_hyd(ig) = pdtsurf_hyd(ig) + (tsea-ztsurf(ig))/oceantime 315 338 end if … … 326 349 totalrunoff=0. 327 350 do ig=1,ngrid 328 if ( rnat(ig).eq.1) then351 if (nint(rnat(ig)).eq.1) then 329 352 totalrunoff = totalrunoff + area(ig)*runoff(ig) 330 353 endif … … 332 355 333 356 do ig=1,ngrid 334 if ( rnat(ig).eq.0) then357 if (nint(rnat(ig)).eq.0) then 335 358 zqsurf(ig,iliq) = zqsurf(ig,iliq) + & 336 359 totalrunoff/oceanarea -
trunk/LMDZ.GENERIC/libf/phystd/inifis.F
r1295 r1297 329 329 call getin("graybody",graybody) 330 330 write(*,*)" graybody = ",graybody 331 332 ! Slab Ocean 333 write(*,*) "Use slab-ocean ?" 334 ok_slab_ocean=.false. ! default value 335 call getin("ok_slab_ocean",ok_slab_ocean) 336 write(*,*) "ok_slab_ocean = ",ok_slab_ocean 337 338 write(*,*) "Use slab-sea-ice ?" 339 ok_slab_sic=.true. ! default value 340 call getin("ok_slab_sic",ok_slab_sic) 341 write(*,*) "ok_slab_sic = ",ok_slab_sic 342 343 write(*,*) "Use heat transport for the ocean ?" 344 ok_slab_heat_transp=.true. ! default value 345 call getin("ok_slab_heat_transp",ok_slab_heat_transp) 346 write(*,*) "ok_slab_heat_transp = ",ok_slab_heat_transp 347 348 331 349 332 350 ! Test of incompatibility: -
trunk/LMDZ.GENERIC/libf/phystd/initracer.F
r861 r1297 172 172 write(*,*)' ',iq,' ',trim(noms(iq)) 173 173 enddo 174 stop174 ! stop 175 175 else 176 176 write(*,*) "initracer: found all expected tracers, namely:" -
trunk/LMDZ.GENERIC/libf/phystd/iostart.F90
r1217 r1297 14 14 INTEGER,SAVE :: idim6 ! "nlayer" dimension 15 15 INTEGER,SAVE :: idim7 ! "Time" dimension 16 INTEGER,SAVE :: idim8 ! "ocean_layers" dimension 16 17 INTEGER,SAVE :: timeindex ! current time index (for time-dependent fields) 17 18 INTEGER,PARAMETER :: length=100 ! size of tab_cntrl array … … 466 467 USE infotrac, only: nqtot 467 468 USE comsoil_h, only: nsoilmx 469 USE slab_ice_h, only: noceanmx 470 468 471 IMPLICIT NONE 469 472 CHARACTER(LEN=*),INTENT(IN) :: filename … … 552 555 ENDIF 553 556 557 ierr=NF90_DEF_DIM(nid_restart,"ocean_layers",noceanmx,idim8) 558 IF (ierr/=NF90_NOERR) THEN 559 write(*,*)'open_restartphy: problem defining oceanic layer dimension ' 560 write(*,*)trim(nf90_strerror(ierr)) 561 CALL ABORT 562 ENDIF 563 564 554 565 ierr=NF90_ENDDEF(nid_restart) 555 566 IF (ierr/=NF90_NOERR) THEN … … 632 643 USE mod_grid_phy_lmdz 633 644 USE mod_phys_lmdz_para 645 USE slab_ice_h, only: noceanmx 634 646 IMPLICIT NONE 635 647 CHARACTER(LEN=*),INTENT(IN) :: field_name … … 817 829 endif ! of if (.not.present(time)) 818 830 831 ELSE IF (field_size==noceanmx) THEN 832 ! input is a 2D "oceanic field" array 833 if (.not.present(time)) then ! for a time-independent field 834 ierr = NF90_REDEF(nid_restart) 835 #ifdef NC_DOUBLE 836 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_DOUBLE,& 837 (/idim2,idim8/),nvarid) 838 #else 839 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_FLOAT,& 840 (/idim2,idim8/),nvarid) 841 #endif 842 if (ierr.ne.NF90_NOERR) then 843 write(*,*)"put_field_rgen error: failed to define "//trim(field_name) 844 write(*,*)trim(nf90_strerror(ierr)) 845 endif 846 IF (LEN_TRIM(title) > 0) ierr=NF90_PUT_ATT(nid_restart,nvarid,"title",title) 847 ierr = NF90_ENDDEF(nid_restart) 848 ierr = NF90_PUT_VAR(nid_restart,nvarid,field_glo) 849 else 850 ! check if the variable has already been defined: 851 ierr=NF90_INQ_VARID(nid_restart,field_name,nvarid) 852 if (ierr/=NF90_NOERR) then ! variable not found, define it 853 ierr=NF90_REDEF(nid_restart) 854 #ifdef NC_DOUBLE 855 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_DOUBLE,& 856 (/idim2,idim8,idim7/),nvarid) 857 #else 858 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_FLOAT,& 859 (/idim2,idim8,idim7/),nvarid) 860 #endif 861 if (ierr.ne.NF90_NOERR) then 862 write(*,*)"put_field_rgen error: failed to define "//trim(field_name) 863 write(*,*)trim(nf90_strerror(ierr)) 864 endif 865 IF (LEN_TRIM(title) > 0) ierr=NF90_PUT_ATT(nid_restart,nvarid,"title",title) 866 ierr=NF90_ENDDEF(nid_restart) 867 endif 868 ! Write the variable 869 ierr=NF90_PUT_VAR(nid_restart,nvarid,field_glo,& 870 start=(/1,1,timeindex/)) 871 872 endif ! of if (.not.present(time)) 873 874 819 875 ELSE 820 876 PRINT *, "Error phyredem(put_field_rgen) : wrong dimension for ",trim(field_name) … … 889 945 USE comsoil_h, only: nsoilmx 890 946 USE mod_phys_lmdz_para, only: is_master 947 USE slab_ice_h, only: noceanmx 891 948 IMPLICIT NONE 892 949 CHARACTER(LEN=*),INTENT(IN) :: var_name … … 939 996 ! We know it is an "mlayer" kind of 1D array 940 997 idim1d=idim3 998 ELSEIF (var_size==noceanmx) THEN 999 ! We know it is an "mlayer" kind of 1D array 1000 idim1d=idim8 941 1001 ELSE 942 1002 PRINT *, "put_var_rgen error : wrong dimension" -
trunk/LMDZ.GENERIC/libf/phystd/lect_start_archive.F
r1216 r1297 1 1 SUBROUTINE lect_start_archive(date,tsurf,tsoil,emis,q2, 2 2 & t,ucov,vcov,ps,h,phisold_newgrid, 3 & q,qsurf,surfith,nid) 3 & q,qsurf,surfith,nid, 4 & rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 4 5 5 6 ! USE surfdat_h … … 7 8 USE tracer_h, ONLY: igcm_co2_ice 8 9 USE infotrac, ONLY: tname, nqtot 10 USE slab_ice_h, ONLY: noceanmx 9 11 ! USE control_mod 12 ! to use 'getin' 10 13 11 14 c======================================================================= … … 39 42 #include "netcdf.inc" 40 43 !#include"advtrac.h" 44 #include "callkeys.h" 41 45 c======================================================================= 42 46 c Declarations … … 100 104 REAL emis(ngridmx) 101 105 REAL q2(ngridmx,nlayermx+1),qsurf(ngridmx,nqtot) 106 REAL tslab(ngridmx,noceanmx) 107 REAL rnat(ngridmx),pctsrf_sic(ngridmx) 108 REAL tsea_ice(ngridmx),sea_ice(ngridmx) 102 109 c REAL phisfi(ngridmx) 103 110 … … 122 129 real emisS(iip1,jjp1) 123 130 REAL q2S(iip1,jjp1,llm+1),qsurfS(iip1,jjp1,nqtot) 131 real tslabS(iip1,jjp1,noceanmx) 132 real pctsrf_sicS(iip1,jjp1),tsea_iceS(iip1,jjp1) 133 real rnatS(iip1,jjp1), sea_iceS(iip1,jjp1) 124 134 125 135 real ptotal, co2icetotal … … 150 160 real, dimension(:,:), allocatable :: emisold 151 161 real, dimension(:,:,:,:), allocatable :: qold 162 real, dimension(:,:,:), allocatable :: tslabold 163 real, dimension(:,:), allocatable :: rnatold,pctsrf_sicold 164 real, dimension(:,:), allocatable :: tsea_iceold,sea_iceold 165 152 166 153 167 real tab_cntrl(100) … … 299 313 allocate(mlayerold(nsoilold)) 300 314 allocate(qsurfold(imold+1,jmold+1,nqtot)) 315 allocate(tslabold(imold+1,jmold+1,noceanmx)) 316 allocate(rnatold(imold+1,jmold+1)) 317 allocate(pctsrf_sicold(imold+1,jmold+1)) 318 allocate(tsea_iceold(imold+1,jmold+1)) 319 allocate(sea_iceold(imold+1,jmold+1)) 301 320 302 321 allocate(var (imold+1,jmold+1,llm)) … … 700 719 ENDIF 701 720 c 721 cc Slab ocean 722 if(ok_slab_ocean) then 723 start=(/1,1,1,memo/) 724 count=(/imold+1,jmold+1,noceanmx,1/) 725 726 ierr=NF_INQ_VARID(nid,"tslab",nvarid) 727 IF (ierr.ne.NF_NOERR) then 728 PRINT*,"lect_start_archive: Cannot find <tslab>" 729 ENDIF 730 #ifdef NC_DOUBLE 731 ierr=NF_GET_VARA_DOUBLE(nid,nvarid,start,count,tslabold) 732 #else 733 ierr=NF_GET_VARA_REAL(nid,nvarid,start,count,tslabold) 734 #endif 735 IF (ierr .NE. NF_NOERR) THEN 736 PRINT*, "lect_start_archive: Lecture echouee pour <tslab>" 737 ENDIF 738 739 740 c 741 start=(/1,1,memo,0/) 742 count=(/imold+1,jmold+1,1,0/) 743 744 ierr = NF_INQ_VARID (nid, "rnat", nvarid) 745 IF (ierr .NE. NF_NOERR) THEN 746 PRINT*, "lect_start_archive: Le champ <rnat> est absent" 747 ENDIF 748 #ifdef NC_DOUBLE 749 ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,rnatold) 750 #else 751 ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,rnatold) 752 #endif 753 IF (ierr .NE. NF_NOERR) THEN 754 PRINT*, "lect_start_archive: Lecture echouee pour <rnat>" 755 ENDIF 756 c 757 ierr = NF_INQ_VARID (nid, "pctsrf_sic", nvarid) 758 IF (ierr .NE. NF_NOERR) THEN 759 PRINT*, "lect_start_archive: Le champ <pctsrf_sic> est absent" 760 ENDIF 761 #ifdef NC_DOUBLE 762 ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,pctsrf_sicold) 763 #else 764 ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,pctsrf_sicold) 765 #endif 766 IF (ierr .NE. NF_NOERR) THEN 767 PRINT*, "lect_start_archive: Lecture echouee pour <pctsrf_sic>" 768 ENDIF 769 c 770 ierr = NF_INQ_VARID (nid, "tsea_ice", nvarid) 771 IF (ierr .NE. NF_NOERR) THEN 772 PRINT*, "lect_start_archive: Le champ <tsea_ice> est absent" 773 ENDIF 774 #ifdef NC_DOUBLE 775 ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,tsea_iceold) 776 #else 777 ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,tsea_iceold) 778 #endif 779 IF (ierr .NE. NF_NOERR) THEN 780 PRINT*, "lect_start_archive: Lecture echouee pour <tsea_ice>" 781 ENDIF 782 c 783 ierr = NF_INQ_VARID (nid, "sea_ice", nvarid) 784 IF (ierr .NE. NF_NOERR) THEN 785 PRINT*, "lect_start_archive: Le champ <sea_ice> est absent" 786 ENDIF 787 #ifdef NC_DOUBLE 788 ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,sea_iceold) 789 #else 790 ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,sea_iceold) 791 #endif 792 IF (ierr .NE. NF_NOERR) THEN 793 PRINT*, "lect_start_archive: Lecture echouee pour <sea_ice>" 794 ENDIF 795 796 ENDIF! ok_slab_ocean 797 c 702 798 write(*,*)"lect_start_archive: rlonuold:" 703 799 & ,rlonuold," rlatvold:",rlatvold … … 971 1067 call gr_dyn_fi (1,iim+1,jjm+1,ngridmx,emiss,emis) 972 1068 c write(46,*) 'emis',emis 1069 1070 1071 973 1072 c----------------------------------------------------------------------- 974 1073 c 6.1.2 Traitement special de la pression au sol : … … 1190 1289 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngridmx,tsoilS,tsoil) 1191 1290 1192 1193 1194 c----------------------------------------------------------------------- 1195 c 6.3 Variable 3d : 1291 c----------------------------------------------------------------------- 1292 c 6.3 Slab Ocean : 1293 c----------------------------------------------------------------------- 1294 call interp_horiz (tslabold,tslabs,imold,jmold,iim,jjm,noceanmx, 1295 & rlonuold,rlatvold,rlonu,rlatv) 1296 call gr_dyn_fi (1,iim+1,jjm+1,ngridmx,tslabs,tslab) 1297 1298 call interp_horiz (rnatold,rnats,imold,jmold,iim,jjm,1, 1299 & rlonuold,rlatvold,rlonu,rlatv) 1300 call gr_dyn_fi (1,iim+1,jjm+1,ngridmx,rnats,rnat) 1301 1302 call interp_horiz (pctsrf_sicold,pctsrf_sics,imold,jmold,iim, 1303 & jjm,1,rlonuold,rlatvold,rlonu,rlatv) 1304 call gr_dyn_fi (1,iim+1,jjm+1,ngridmx,pctsrf_sics,pctsrf_sic) 1305 1306 call interp_horiz (tsea_iceold,tsea_ices,imold,jmold,iim,jjm,1, 1307 & rlonuold,rlatvold,rlonu,rlatv) 1308 call gr_dyn_fi (1,iim+1,jjm+1,ngridmx,tsea_ices,tsea_ice) 1309 1310 call interp_horiz (sea_iceold,sea_ices,imold,jmold,iim,jjm,1, 1311 & rlonuold,rlatvold,rlonu,rlatv) 1312 call gr_dyn_fi (1,iim+1,jjm+1,ngridmx,sea_ices,sea_ice) 1313 1314 c----------------------------------------------------------------------- 1315 c 6.4 Variable 3d : 1196 1316 c----------------------------------------------------------------------- 1197 1317 … … 1362 1482 deallocate(qsurfold) 1363 1483 deallocate(var,varp1) 1484 deallocate(tslabold) 1485 deallocate(rnatold) 1486 deallocate(pctsrf_sicold) 1487 deallocate(tsea_iceold) 1488 deallocate(sea_iceold) 1364 1489 1365 1490 ! write(*,*)'lect_start_archive: END' -
trunk/LMDZ.GENERIC/libf/phystd/newstart.F
r1252 r1297 28 28 use iostart, only: open_startphy 29 29 use comgeomphy, only: initcomgeomphy 30 use slab_ice_h, only:noceanmx 30 31 implicit none 31 32 … … 108 109 109 110 integer ierr 111 112 REAL rnat(ngridmx) 113 REAL tslab(ngridmx,nsoilmx) ! slab ocean temperature 114 REAL pctsrf_sic(ngridmx) ! sea ice cover 115 REAL tsea_ice(ngridmx) ! temperature sea_ice 116 REAL sea_ice(ngridmx) ! mass of sea ice (kg/m2) 110 117 111 118 c Variables on the new grid along scalar points … … 167 174 REAL totalfrac(ngridmx) 168 175 176 169 177 ! added by RW for nuketharsis 170 178 real fact1 … … 186 194 CALL init_phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) 187 195 call initcomgeomphy 188 189 196 ! Load tracer number and names: 190 197 call iniadvtrac(nqtot,numvanle) … … 196 203 c Choice of the start file(s) to use 197 204 c======================================================================= 198 199 205 write(*,*) 'From which kind of files do you want to create new', 200 206 . 'start and startfi files' … … 288 294 c Lecture du tableau des parametres du run (pour la dynamique) 289 295 c----------------------------------------------------------------------- 290 291 296 if (choix_1.eq.0) then 292 297 … … 339 344 . day_ini,time, 340 345 . tsurf,tsoil,emis,q2,qsurf, !) ! temporary modif by RDW 341 . cloudfrac,totalfrac,hice) 346 . cloudfrac,totalfrac,hice,rnat,pctsrf_sic,tslab,tsea_ice, 347 . sea_ice) 342 348 343 349 ! copy albedo and soil thermal inertia on (local) physics grid … … 529 535 write(*,*) 'Reading file START_ARCHIVE' 530 536 CALL lect_start_archive(date,tsurf,tsoil,emis,q2, 531 . t,ucov,vcov,ps,teta,phisold_newgrid,q,qsurf, 532 & surfith,nid) 537 & t,ucov,vcov,ps,teta,phisold_newgrid,q,qsurf, 538 & surfith,nid, 539 & rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 533 540 write(*,*) "OK, read start_archive file" 534 541 ! copy soil thermal inertia … … 589 596 write(*,*) 'therm_ini_s : Set soil thermal inertia to reference sur 590 597 &face values' 598 write(*,*) 'slab_ocean_0 : initialisation of slab 599 $ocean variables' 591 600 592 601 write(*,*) … … 1373 1382 ! ---------------------------------------------------------------------- 1374 1383 1375 else if (trim(modif) .eq.'therm_ini_s') then1384 else if (trim(modif) .eq. 'therm_ini_s') then 1376 1385 ! write(*,*)"surfithfi(1):",surfithfi(1) 1377 1386 do isoil=1,nsoilmx … … 1394 1403 1395 1404 1405 1406 c slab_ocean_initialisation 1407 c ------------------------------------------------ 1408 else if (trim(modif) .eq. 'slab_ocean_0') then 1409 write(*,*)'OK: initialisation of slab ocean' 1410 1411 DO ig=1, ngridmx 1412 rnat(ig)=1. 1413 tslab(ig,1)=0. 1414 tslab(ig,2)=0. 1415 tsea_ice(ig)=0. 1416 sea_ice(ig)=0. 1417 pctsrf_sic(ig)=0. 1418 1419 if(ithfi(ig,1).GT.10000.)then 1420 rnat(ig)=0. 1421 phisfi(ig)=0. 1422 tsea_ice(ig)=273.15-1.8 1423 tslab(ig,1)=tsurf(ig) 1424 tslab(ig,2)=tsurf(ig)!*2./3.+(273.15-1.8)/3. 1425 endif 1426 1427 ENDDO 1428 CALL gr_fi_dyn(1,ngridmx,iip1,jjp1,phisfi,phis) 1429 1430 1431 1396 1432 else 1397 1433 write(*,*) ' Unknown (misspelled?) option!!!' 1398 1434 end if ! of if (trim(modif) .eq. '...') elseif ... 1399 1400 1401 1402 1403 1404 1405 1406 1407 1435 1408 1436 … … 1433 1461 ! ENDIF 1434 1462 ! ENDDO 1463 1464 1465 1435 1466 1436 1467 c======================================================================= … … 1540 1571 & dtphys,real(day_ini), 1541 1572 & tsurf,tsoil,emis,q2,qsurf, 1542 & cloudfrac,totalfrac,hice) 1573 & cloudfrac,totalfrac,hice, 1574 & rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 1543 1575 1544 1576 c======================================================================= -
trunk/LMDZ.GENERIC/libf/phystd/phyetat0.F90
r1252 r1297 1 1 subroutine phyetat0 (ngrid,fichnom,tab0,Lmodif,nsoil,nq, & 2 2 day_ini,time,tsurf,tsoil, & 3 emis,q2,qsurf,cloudfrac,totcloudfrac,hice) 3 emis,q2,qsurf,cloudfrac,totcloudfrac,hice, & 4 rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 5 4 6 5 7 USE infotrac, ONLY: tname … … 8 10 get_field, get_var, inquire_field, & 9 11 inquire_dimension, inquire_dimension_length 12 use slab_ice_h, only: noceanmx 10 13 11 14 implicit none … … 47 50 real,intent(out) :: cloudfrac(ngrid,nlayermx) 48 51 real,intent(out) :: hice(ngrid), totcloudfrac(ngrid) 52 real,intent(out) :: pctsrf_sic(ngrid),tslab(ngrid,noceanmx) 53 real,intent(out) :: tsea_ice(ngrid),sea_ice(ngrid) 54 real,intent(out) :: rnat(ngrid) 49 55 50 56 !====================================================================== … … 89 95 IF (.not. ALLOCATED(zthe)) ALLOCATE(zthe(ngrid)) 90 96 97 91 98 ! open physics initial state file: 92 99 call open_startphy(fichnom) … … 270 277 if (.not.found) then 271 278 write(*,*) "phyetat0: Failed loading <hice>" 272 call abort 279 ! call abort 280 do ig=1,ngrid 281 hice(ig)=0. 282 enddo 273 283 else 274 284 write(*,*) "phyetat0: Height of oceanic ice <hice> range:", & 275 285 minval(hice), maxval(hice) 276 286 endif 287 288 ! SLAB OCEAN (added by BC 2014) 289 ! nature of the surface 290 call get_field("rnat",rnat,found,indextime) 291 if (.not.found) then 292 write(*,*) "phyetat0: Failed loading <rnat>" 293 do ig=1,ngrid 294 rnat(ig)=1. 295 enddo 296 else 297 do ig=1,ngrid 298 if((nint(rnat(ig)).eq.2).or.(nint(rnat(ig)).eq.0))then 299 rnat(ig)=0. 300 else 301 rnat(ig)=1. 302 endif 303 enddo 304 305 write(*,*) "phyetat0: Nature of surface <rnat> range:", & 306 minval(rnat), maxval(rnat) 307 endif 308 ! Pourcentage of sea ice cover 309 call get_field("pctsrf_sic",pctsrf_sic,found,indextime) 310 if (.not.found) then 311 write(*,*) "phyetat0: Failed loading <pctsrf_sic>" 312 do ig=1,ngrid 313 pctsrf_sic(ig)=0. 314 enddo 315 else 316 write(*,*) "phyetat0: Pourcentage of sea ice cover <pctsrf_sic> range:", & 317 minval(pctsrf_sic), maxval(pctsrf_sic) 318 endif 319 ! Slab ocean temperature (2 layers) 320 call get_field("tslab",tslab,found,indextime) 321 if (.not.found) then 322 write(*,*) "phyetat0: Failed loading <tslab>" 323 do ig=1,ngrid 324 do iq=1,noceanmx 325 tslab(ig,iq)=tsurf(ig) 326 enddo 327 enddo 328 else 329 write(*,*) "phyetat0: Slab ocean temperature <tslab> range:", & 330 minval(tslab), maxval(tslab) 331 endif 332 ! Oceanic ice temperature 333 call get_field("tsea_ice",tsea_ice,found,indextime) 334 if (.not.found) then 335 write(*,*) "phyetat0: Failed loading <tsea_ice>" 336 do ig=1,ngrid 337 tsea_ice(ig)=273.15-1.8 338 enddo 339 else 340 write(*,*) "phyetat0: Oceanic ice temperature <tsea_ice> range:", & 341 minval(tsea_ice), maxval(tsea_ice) 342 endif 343 ! Oceanic ice quantity (kg/m^2) 344 call get_field("sea_ice",sea_ice,found,indextime) 345 if (.not.found) then 346 write(*,*) "phyetat0: Failed loading <sea_ice>" 347 do ig=1,ngrid 348 tsea_ice(ig)=0. 349 enddo 350 else 351 write(*,*) "phyetat0: Oceanic ice quantity <sea_ice> range:", & 352 minval(sea_ice), maxval(sea_ice) 353 endif 354 355 356 277 357 278 358 ! pbl wind variance … … 308 388 endif ! of if (nq.ge.1) 309 389 390 310 391 ! Call to soil_settings, in order to read soil temperatures, 311 392 ! as well as thermal inertia and volumetric heat capacity 312 313 393 call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime) 314 315 394 ! 316 395 ! close file: -
trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90
r1222 r1297 135 135 subroutine physdem1(filename,nsoil,ngrid,nlay,nq, & 136 136 phystep,time,tsurf,tsoil,emis,q2,qsurf, & 137 cloudfrac,totcloudfrac,hice) 137 cloudfrac,totcloudfrac,hice, & 138 rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 138 139 ! write time-dependent variable to restart file 139 140 use iostart, only : open_restartphy, close_restartphy, & 140 141 put_var, put_field 141 142 use infotrac, only: tname 143 use slab_ice_h, only: noceanmx 144 142 145 implicit none 143 146 !====================================================================== … … 145 148 #include "comcstfi.h" 146 149 #include "planete.h" 150 #include "callkeys.h" 147 151 !====================================================================== 148 152 character(len=*),intent(in) :: filename … … 161 165 real,intent(in) :: totcloudfrac(ngrid) 162 166 real,intent(in) :: hice(ngrid) 167 real,intent(in) :: rnat(ngrid) 168 real,intent(in) :: pctsrf_sic(ngrid) 169 real,intent(in) :: tslab(ngrid,noceanmx) 170 real,intent(in) :: tsea_ice(ngrid) 171 real,intent(in) :: sea_ice(ngrid) 163 172 164 173 integer :: iq … … 187 196 call put_field("totcloudfrac","Total fraction",totcloudfrac) 188 197 call put_field("hice","Height of oceanic ice",hice) 198 199 !Slab ocean 200 if(ok_slab_ocean) then 201 call put_field("rnat","Nature of surface",rnat) 202 call put_field("pctsrf_sic","Pourcentage sea ice",pctsrf_sic) 203 call put_field("tslab","Temperature slab ocean",tslab) 204 call put_field("tsea_ice","Temperature sea ice",tsea_ice) 205 call put_field("sea_ice","Sea ice mass",sea_ice) 206 endif!(ok_slab_ocean) 207 189 208 190 209 ! tracers -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r1295 r1297 26 26 use control_mod, only: ecritphy, iphysiq, nday 27 27 use phyredem, only: physdem0, physdem1 28 use slab_ice_h 29 use ocean_slab_mod, only :ocean_slab_init, ocean_slab_ice, & 30 ocean_slab_get_vars,ocean_slab_final 31 use surf_heat_transp_mod,only :init_masquv 28 32 use planetwide_mod, only: planetwide_minval,planetwide_maxval,planetwide_sumval 29 33 use mod_phys_lmdz_para, only : is_master 34 30 35 31 36 implicit none … … 184 189 185 190 real,dimension(:),allocatable,save :: albedo0 ! Surface albedo 186 integer,dimension(:),allocatable,save :: rnat ! added by BC191 real,dimension(:),allocatable,save :: rnat ! added by BC 187 192 188 193 real,dimension(:),allocatable,save :: emis ! Thermal IR surface emissivity … … 276 281 real zdh(ngrid,nlayermx) 277 282 real gmplanet 283 real taux(ngrid),tauy(ngrid) 278 284 279 285 integer length … … 431 437 real, dimension(:), allocatable :: tmp_fract ! day fraction of the time interval 432 438 real, dimension(:), allocatable :: tmp_mu0 ! equivalent solar angle 439 440 ! included by BC for slab ocean 441 real, dimension(:),allocatable,save :: pctsrf_sic 442 real, dimension(:,:),allocatable,save :: tslab 443 real, dimension(:),allocatable,save :: tsea_ice 444 real, dimension(:),allocatable,save :: sea_ice 445 real, dimension(:),allocatable,save :: zmasq 446 integer, dimension(:),allocatable,save ::knindex 447 448 real :: tsurf2(ngrid) 449 real :: flux_o(ngrid),flux_g(ngrid),fluxgrdocean(ngrid) 450 real :: dt_ekman(ngrid,noceanmx),dt_hdiff(ngrid,noceanmx) 451 real :: flux_sens_lat(ngrid) 452 real :: qsurfint(ngrid,nq) 453 454 433 455 !======================================================================= 434 456 … … 475 497 ALLOCATE(zdtsw(ngrid,nlayermx)) 476 498 ALLOCATE(tau_col(ngrid)) 499 ALLOCATE(pctsrf_sic(ngrid)) 500 ALLOCATE(tslab(ngrid,noceanmx)) 501 ALLOCATE(tsea_ice(ngrid)) 502 ALLOCATE(sea_ice(ngrid)) 503 ALLOCATE(zmasq(ngrid)) 504 ALLOCATE(knindex(ngrid)) 505 ! ALLOCATE(qsurfint(ngrid,nqmx)) 506 477 507 478 508 !! this is defined in comsaison_h … … 513 543 call phyetat0(ngrid,"startfi.nc",0,0,nsoilmx,nq, & 514 544 day_ini,time_phys,tsurf,tsoil,emis,q2,qsurf, & 515 cloudfrac,totcloudfrac,hice) 545 cloudfrac,totcloudfrac,hice, & 546 rnat,pctsrf_sic,tslab, tsea_ice,sea_ice) 516 547 517 548 if (pday.ne.day_ini) then … … 537 568 endif 538 569 570 ! Initialize oceanic variables 571 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 572 573 if (ok_slab_ocean)then 574 575 call ocean_slab_init(ngrid,ptimestep, tslab, & 576 sea_ice, pctsrf_sic) 577 578 knindex(:) = 0 579 580 do ig=1,ngrid 581 zmasq(ig)=1 582 knindex(ig) = ig 583 if (nint(rnat(ig)).eq.0) then 584 zmasq(ig)=0 585 endif 586 enddo 587 588 589 CALL init_masquv(zmasq) 590 591 592 endif 593 594 539 595 ! initialize soil 540 596 ! ~~~~~~~~~~~~~~~ … … 542 598 call soil(ngrid,nsoilmx,firstcall,lastcall,inertiedat, & 543 599 ptimestep,tsurf,tsoil,capcal,fluxgrd) 600 601 if (ok_slab_ocean) then 602 do ig=1,ngrid 603 if (nint(rnat(ig)).eq.2) then 604 capcal(ig)=capcalocean 605 if (pctsrf_sic(ig).gt.0.5) then 606 capcal(ig)=capcalseaice 607 if (qsurf(ig,igcm_h2o_ice).gt.0.) then 608 capcal(ig)=capcalsno 609 endif 610 endif 611 endif 612 enddo 613 endif 614 615 616 617 544 618 else 545 619 print*,'WARNING! Thermal conduction in the soil turned off' … … 572 646 endif 573 647 648 ! In newstart now, will have to be remove (BC 2014) 574 649 ! define surface as continent or ocean 575 650 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 576 rnat(:)=1 577 do ig=1,ngrid 578 ! if(iceball.or.oceanball.or.(inertiedat(ig,1).gt.1.E4))then 579 if(inertiedat(ig,1).gt.1.E4)then 580 rnat(ig)=0 581 endif 582 enddo 583 584 print*,'WARNING! Surface type currently decided by surface inertia' 585 print*,'This should be improved e.g. in newstart.F' 586 651 if (.not.ok_slab_ocean) then 652 rnat(:)=1. 653 do ig=1,ngrid 654 ! if(iceball.or.oceanball.or.(inertiedat(ig,1).gt.1.E4))then 655 if(inertiedat(ig,1).gt.1.E4)then 656 rnat(ig)=0 657 endif 658 enddo 659 660 print*,'WARNING! Surface type currently decided by surface inertia' 661 print*,'This should be improved e.g. in newstart.F' 662 endif!(.not.ok_slab_ocean) 587 663 588 664 ! initialise surface history variable … … 644 720 ! Initialize various variables 645 721 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 646 722 647 723 pdu(1:ngrid,1:nlayermx) = 0.0 648 724 pdv(1:ngrid,1:nlayermx) = 0.0 … … 655 731 zdtsurf(1:ngrid) = 0.0 656 732 dqsurf(1:ngrid,1:nq)= 0.0 733 flux_sens_lat(1:ngrid) = 0.0 734 taux(1:ngrid) = 0.0 735 tauy(1:ngrid) = 0.0 736 737 738 657 739 658 740 zday=pday+ptime ! compute time, in sols (and fraction thereof) … … 674 756 else if (flatten .eq. 0.0 .or. J2 .eq. 0.0 .or. Rmean .eq. 0.0 .or. MassPlanet .eq. 0.0) then 675 757 print*,'I need values for flatten, J2, Rmean and MassPlanet to compute glat (else set oblate=.false.)' 758 676 759 call abort 677 760 else … … 817 900 818 901 ! standard callcorrk 819 clearsky=.false. 820 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 902 903 904 905 906 if(ok_slab_ocean) then 907 tsurf2(:)=tsurf(:) 908 do ig=1,ngrid 909 if (nint(rnat(ig))==0) then 910 tsurf(ig)=((1.-pctsrf_sic(ig))*tslab(ig,1)**4+pctsrf_sic(ig)*tsea_ice(ig)**4)**0.25 911 endif 912 enddo 913 endif!(ok_slab_ocean) 914 915 916 clearsky=.false. 917 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 821 918 albedo,emis,mu0,pplev,pplay,pt, & 822 919 tsurf,fract,dist_star,aerosol,muvar, & … … 827 924 828 925 ! Option to call scheme once more for clear regions 829 if(CLFvarying)then926 if(CLFvarying)then 830 927 831 928 ! ---> PROBLEMS WITH ALLOCATED ARRAYS 832 929 ! (temporary solution in callcorrk: do not deallocate if CLFvarying ...) 833 clearsky=.true.834 call callcorrk(ngrid,nlayer,pq,nq,qsurf, &930 clearsky=.true. 931 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 835 932 albedo,emis,mu0,pplev,pplay,pt, & 836 933 tsurf,fract,dist_star,aerosol,muvar, & … … 839 936 tau_col1,cloudfrac,totcloudfrac, & 840 937 clearsky,firstcall,lastcall) 841 clearsky = .false. ! just in case. 938 clearsky = .false. ! just in case. 939 842 940 843 941 ! Sum the fluxes and heating rates from cloudy/clear cases 844 do ig=1,ngrid845 tf=totcloudfrac(ig)846 ntf=1.-tf942 do ig=1,ngrid 943 tf=totcloudfrac(ig) 944 ntf=1.-tf 847 945 848 946 fluxsurf_lw(ig) = ntf*fluxsurf_lw1(ig) + tf*fluxsurf_lw(ig) … … 861 959 862 960 endif !CLFvarying 961 962 if(ok_slab_ocean) then 963 tsurf(:)=tsurf2(:) 964 endif!(ok_slab_ocean) 965 863 966 864 967 ! Radiative flux from the sky absorbed by the surface (W.m-2) … … 958 1061 zdum1,zdum2,pdt,pdq,zflubid, & 959 1062 zdudif,zdvdif,zdtdif,zdtsdif, & 960 sensibFlux,q2,zdqdif,zdqevap,zdqsdif,lastcall) 1063 sensibFlux,q2,zdqdif,zdqevap,zdqsdif, & 1064 taux,tauy,lastcall) 961 1065 962 1066 else … … 970 1074 zdum1,zdum2,zdh,pdq,zflubid, & 971 1075 zdudif,zdvdif,zdhdif,zdtsdif, & 972 sensibFlux,q2,zdqdif,zdqsdif,lastcall) 1076 sensibFlux,q2,zdqdif,zdqsdif, & 1077 taux,tauy,lastcall) 973 1078 974 1079 zdtdif(1:ngrid,1:nlayermx)=zdhdif(1:ngrid,1:nlayermx)*zpopsk(1:ngrid,1:nlayermx) ! for diagnostic only … … 981 1086 pdt(1:ngrid,1:nlayermx)=pdt(1:ngrid,1:nlayermx)+zdtdif(1:ngrid,1:nlayermx) 982 1087 zdtsurf(1:ngrid)=zdtsurf(1:ngrid)+zdtsdif(1:ngrid) 1088 1089 if(ok_slab_ocean)then 1090 flux_sens_lat(1:ngrid)=(zdtsdif(1:ngrid)*capcal(1:ngrid)-fluxrad(1:ngrid)) 1091 endif 1092 1093 1094 983 1095 if (tracer) then 984 1096 pdq(1:ngrid,1:nlayermx,1:nq)=pdq(1:ngrid,1:nlayermx,1:nq)+ zdqdif(1:ngrid,1:nlayermx,1:nq) … … 1403 1515 1404 1516 1517 ! 7e. Ocean 1518 ! --------- 1519 1520 ! --------------------------------- 1521 ! Slab_ocean 1522 ! --------------------------------- 1523 if (ok_slab_ocean)then 1524 1525 do ig=1,ngrid 1526 qsurfint(:,igcm_h2o_ice)=qsurf(:,igcm_h2o_ice) 1527 enddo 1528 1529 call ocean_slab_ice(ptimestep, & 1530 ngrid, knindex, tsea_ice, fluxrad, & 1531 zdqssnow, qsurf(:,igcm_h2o_ice), & 1532 -zdqsdif(:,igcm_h2o_vap), & 1533 flux_sens_lat,tsea_ice, pctsrf_sic, & 1534 taux,tauy,icount) 1535 1536 1537 call ocean_slab_get_vars(ngrid,tslab, & 1538 sea_ice, flux_o, & 1539 flux_g, dt_hdiff, & 1540 dt_ekman) 1541 1542 do ig=1,ngrid 1543 if (nint(rnat(ig)).eq.1)then 1544 tslab(ig,1) = 0. 1545 tslab(ig,2) = 0. 1546 tsea_ice(ig) = 0. 1547 sea_ice(ig) = 0. 1548 pctsrf_sic(ig) = 0. 1549 qsurf(ig,igcm_h2o_ice)=qsurfint(ig,igcm_h2o_ice) 1550 endif 1551 enddo 1552 1553 1554 endif! (ok_slab_ocean) 1405 1555 1406 1556 ! --------------------------------- … … 1409 1559 1410 1560 if(hydrology)then 1411 1561 1412 1562 call hydrol(ngrid,nq,ptimestep,rnat,tsurf,qsurf,dqsurf,dqs_hyd, & 1413 capcal,albedo0,albedo,mu0,zdtsurf,zdtsurf_hyd,hice) 1563 capcal,albedo0,albedo,mu0,zdtsurf,zdtsurf_hyd,hice,pctsrf_sic, & 1564 sea_ice) 1414 1565 ! note: for now, also changes albedo in the subroutine 1415 1566 … … 1462 1613 1463 1614 ! Increment surface temperature 1464 tsurf(1:ngrid)=tsurf(1:ngrid)+ptimestep*zdtsurf(1:ngrid) 1615 1616 if(ok_slab_ocean)then 1617 do ig=1,ngrid 1618 if (nint(rnat(ig)).eq.0)then 1619 zdtsurf(ig)= (tslab(ig,1) & 1620 + pctsrf_sic(ig)*(tsea_ice(ig)-tslab(ig,1))-tsurf(ig))/ptimestep 1621 endif 1622 tsurf(ig)=tsurf(ig)+ptimestep*zdtsurf(ig) 1623 enddo 1624 1625 else 1626 tsurf(1:ngrid)=tsurf(1:ngrid)+ptimestep*zdtsurf(1:ngrid) 1627 endif!(ok_slab_ocean) 1465 1628 1466 1629 ! Compute soil temperatures and subsurface heat flux 1467 1630 if (callsoil) then 1468 1631 call soil(ngrid,nsoilmx,.false.,lastcall,inertiedat, & 1469 ptimestep,tsurf,tsoil,capcal,fluxgrd) 1632 ptimestep,tsurf,tsoil,capcal,fluxgrd) 1470 1633 endif 1634 1635 1636 if (ok_slab_ocean) then 1637 do ig=1,ngrid 1638 fluxgrdocean(ig)=fluxgrd(ig) 1639 if (nint(rnat(ig)).eq.0) then 1640 capcal(ig)=capcalocean 1641 fluxgrd(ig)=0. 1642 fluxgrdocean(ig)=pctsrf_sic(ig)*flux_g(ig)+(1-pctsrf_sic(ig))*(dt_hdiff(ig,1)+dt_ekman(ig,1)) 1643 do iq=1,nsoilmx 1644 tsoil(ig,iq)=tsurf(ig) 1645 enddo 1646 if (pctsrf_sic(ig).gt.0.5) then 1647 capcal(ig)=capcalseaice 1648 if (qsurf(ig,igcm_h2o_ice).gt.0.) then 1649 capcal(ig)=capcalsno 1650 endif 1651 endif 1652 endif 1653 enddo 1654 endif !(ok_slab_ocean) 1471 1655 1472 1656 !------------------------- … … 1744 1928 ptimestep,ztime_fin, & 1745 1929 tsurf,tsoil,emis,q2,qsurf_hist, & 1746 cloudfrac,totcloudfrac,hice) 1930 cloudfrac,totcloudfrac,hice, & 1931 rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 1747 1932 endif 1933 1934 if(ok_slab_ocean) then 1935 call ocean_slab_final!(tslab, seaice) 1936 end if 1937 1748 1938 1749 1939 endif ! of if (lastcall) … … 1778 1968 call wstats(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw) 1779 1969 call wstats(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw) 1780 1970 call wstats(ngrid,"ALB","Surface albedo"," ",2,albedo) 1971 call wstats(ngrid,"p","Pressure","Pa",3,pplay) 1781 1972 call wstats(ngrid,"temp","Atmospheric temperature","K",3,zt) 1782 1973 call wstats(ngrid,"u","Zonal (East-West) wind","m.s-1",3,zu) … … 1806 1997 endif !tracer 1807 1998 1999 if(watercond.and.CLFvarying)then 2000 call wstats(ngrid,"rneb_man","H2O cloud fraction (conv)"," ",3,rneb_man) 2001 call wstats(ngrid,"rneb_lsc","H2O cloud fraction (large scale)"," ",3,rneb_lsc) 2002 call wstats(ngrid,"CLF","H2O cloud fraction"," ",3,cloudfrac) 2003 call wstats(ngrid,"CLFt","H2O column cloud fraction"," ",2,totcloudfrac) 2004 call wstats(ngrid,"RH","relative humidity"," ",3,RH) 2005 endif 2006 2007 2008 2009 if (ok_slab_ocean) then 2010 call wstats(ngrid,"dt_hdiff1","dt_hdiff1","K/s",2,dt_hdiff(:,1)) 2011 call wstats(ngrid,"dt_hdiff2","dt_hdiff2","K/s",2,dt_hdiff(:,2)) 2012 call wstats(ngrid,"dt_ekman1","dt_ekman1","K/s",2,dt_ekman(:,1)) 2013 call wstats(ngrid,"dt_ekman2","dt_ekman2","K/s",2,dt_ekman(:,2)) 2014 call wstats(ngrid,"tslab1","tslab1","K",2,tslab(:,1)) 2015 call wstats(ngrid,"tslab2","tslab2","K",2,tslab(:,2)) 2016 call wstats(ngrid,"pctsrf_sic","pct ice/sea","",2,pctsrf_sic) 2017 call wstats(ngrid,"tsea_ice","tsea_ice","K",2,tsea_ice) 2018 call wstats(ngrid,"sea_ice","sea ice","kg/m2",2,sea_ice) 2019 call wstats(ngrid,"rnat","nature of the surface","",2,rnat) 2020 endif! (ok_slab_ocean) 2021 1808 2022 if(lastcall) then 1809 2023 write (*,*) "Writing stats..." … … 1833 2047 ! call writediagsoil(ngrid,"tsurf","Surface temperature","K",2,tsurf) 1834 2048 ! call writediagsoil(ngrid,"temp","temperature","K",3,tsoil) 2049 2050 ! Oceanic layers 2051 if(ok_slab_ocean) then 2052 call writediagfi(ngrid,"pctsrf_sic","pct ice/sea","",2,pctsrf_sic) 2053 call writediagfi(ngrid,"tsea_ice","tsea_ice","K",2,tsea_ice) 2054 call writediagfi(ngrid,"sea_ice","sea ice","kg/m2",2,sea_ice) 2055 call writediagfi(ngrid,"tslab1","tslab1","K",2,tslab(:,1)) 2056 call writediagfi(ngrid,"tslab2","tslab2","K",2,tslab(:,2)) 2057 call writediagfi(ngrid,"dt_hdiff1","dt_hdiff1","K/s",2,dt_hdiff(:,1)) 2058 call writediagfi(ngrid,"dt_hdiff2","dt_hdiff2","K/s",2,dt_hdiff(:,2)) 2059 call writediagfi(ngrid,"dt_ekman1","dt_ekman1","K/s",2,dt_ekman(:,1)) 2060 call writediagfi(ngrid,"dt_ekman2","dt_ekman2","K/s",2,dt_ekman(:,2)) 2061 call writediagfi(ngrid,"rnat","nature of the surface","",2,rnat) 2062 call writediagfi(ngrid,"sensibFlux","sensible heat flux","w.m^-2",2,sensibFlux) 2063 call writediagfi(ngrid,"latentFlux","latent heat flux","w.m^-2",2,zdqsdif(:,igcm_h2o_vap)*RLVTT) 2064 endif! (ok_slab_ocean) 1835 2065 1836 2066 ! Total energy balance diagnostics … … 1847 2077 ! call writediagfi(ngrid,"fluxsurfswcs","sw surface flux (cs).","W m-2",2,fluxsurf_sw1) 1848 2078 ! call writediagfi(ngrid,"fluxsurflwcs","lw back radiation (cs).","W m-2",2,fluxsurf_lw1) 1849 call writediagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrd) 2079 if(ok_slab_ocean) then 2080 call writediagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrdocean) 2081 else 2082 call writediagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrd) 2083 endif!(ok_slab_ocean) 1850 2084 call writediagfi(ngrid,"DYN","dynamical heat input","W m-2",2,fluxdyn) 1851 2085 endif … … 1917 2151 endif 1918 2152 1919 if( hydrology)then2153 if((hydrology).and.(.not.ok_slab_ocean))then 1920 2154 call writediagfi(ngrid,"hice","oceanic ice height","m",2,hice) 1921 2155 endif -
trunk/LMDZ.GENERIC/libf/phystd/soil_settings.F
r1216 r1297 65 65 real,dimension(:,:),allocatable :: oldinertiedat 66 66 real,dimension(:,:),allocatable :: oldtsoil 67 68 67 ! for interpolation 69 68 real,dimension(:),allocatable :: oldgrid … … 77 76 78 77 logical :: found,ok 79 80 !====================================================================== 81 78 !====================================================================== 82 79 ! 1. Depth coordinate 83 80 ! ------------------- 84 85 81 ! 1.1 Start by reading how many layers of soil there are 86 87 82 dimlen=inquire_dimension_length("subsurface_layers") 88 83 … … 94 89 interpol=.true. 95 90 endif 96 97 91 ! 1.2 Find out the # of dimensions <inertiedat> was defined as using 98 99 92 ndims=inquire_field_ndims("inertiedat") 100 101 93 ! 1.3 Read depths values or set olddepthdef flag and values 102 94 if (ndims.eq.1) then ! we know that there is none … … 125 117 else ! put values in mlayer 126 118 call get_var("soildepth",mlayer,found) 127 if (.not.found) then 119 print*,"mlayer",mlayer 120 if (.not.found) then 128 121 write(*,*)'soil_settings: Problem while reading <soildepth>' 129 122 endif 130 123 endif !of if (interpol) 131 124 endif !of if (ndims.eq.1) 132 133 125 ! 1.4 Build mlayer(), if necessary 134 126 if (interpol) then … … 139 131 do iloop=0,nsoil-1 140 132 mlayer(iloop)=lay1*(alpha**(iloop-0.5)) 141 133 enddo 142 134 endif 143 144 135 ! 1.5 Build layer(); following the same law as mlayer() 145 136 ! Assuming layer distribution follows mid-layer law: … … 150 141 layer(iloop)=lay1*(alpha**(iloop-1)) 151 142 enddo 152 153 143 ! 2. Volumetric heat capacity (note: it is declared in comsoil_h) 154 144 ! --------------------------- … … 168 158 ! 3. Thermal inertia (note: it is declared in comsoil_h) 169 159 ! ------------------ 170 171 160 ! 3.1 Look (again) for thermal inertia data (to reset nvarid) 172 161 … … 219 208 ! 4. Read soil temperatures 220 209 ! ------------------------- 221 222 210 ! ierr=nf90_inq_varid(nid,"tsoil",nvarid) 223 211 ok=inquire_field("tsoil") … … 255 243 ! 5. If necessary, interpolate soil temperatures and thermal inertias 256 244 ! ------------------------------------------------------------------- 257 258 245 if (olddepthdef) then 259 246 ! tsoil needs to be interpolated, but not therm_i … … 339 326 xmax = MAXVAL(tsoil) 340 327 write(*,*)'Soil temperature <tsoil>:',xmin,xmax 341 342 328 end -
trunk/LMDZ.GENERIC/libf/phystd/start2archive.F
r1252 r1297 24 24 ! use control_mod 25 25 use comgeomphy, only: initcomgeomphy 26 use slab_ice_h, only: noceanmx 27 ! to use 'getin' 28 USE ioipsl_getincom 29 26 30 implicit none 27 31 … … 41 45 !#include"advtrac.h" 42 46 #include "netcdf.inc" 43 47 #include "callkeys.h" 44 48 c----------------------------------------------------------------------- 45 49 c Declarations … … 78 82 REAL cloudfrac(ngridmx,nlayermx),totalcloudfrac(ngridmx) 79 83 84 ! added by BC for slab ocean 85 REAL rnat(ngridmx),pctsrf_sic(ngridmx),sea_ice(ngridmx) 86 REAL tslab(ngridmx,noceanmx),tsea_ice(ngridmx) 87 80 88 81 89 c Variable naturelle / grille scalaire … … 93 101 REAL hiceS(ip1jmp1) 94 102 REAL cloudfracS(ip1jmp1,llm),totalcloudfracS(ip1jmp1) 103 104 ! added by BC for slab ocean 105 REAL rnatS(ip1jmp1),pctsrf_sicS(ip1jmp1),sea_iceS(ip1jmp1) 106 REAL tslabS(ip1jmp1,noceanmx),tsea_iceS(ip1jmp1) 107 95 108 96 109 c Variables intermediaires : vent naturel, mais pas coord scalaire … … 185 198 Lmodif=0 186 199 200 187 201 CALL phyetat0 (ngridmx,fichnom,0,Lmodif,nsoilmx,nqtot,day_ini_fi, 188 202 . timefi, 189 203 . tsurf,tsoil,emis,q2,qsurf, 190 204 ! change FF 05/2011 191 . cloudfrac,totalcloudfrac,hice) 205 . cloudfrac,totalcloudfrac,hice, 206 ! change BC 05/2014 207 . rnat,pctsrf_sic,tslab,tsea_ice,sea_ice) 208 209 192 210 193 211 … … 303 321 call gr_fi_dyn(1,ngridmx,iip1,jjp1,totalcloudfrac,totalcloudfracS) 304 322 323 call gr_fi_dyn(1,ngridmx,iip1,jjp1,rnat,rnatS) 324 call gr_fi_dyn(1,ngridmx,iip1,jjp1,pctsrf_sic,pctsrf_sicS) 325 call gr_fi_dyn(1,ngridmx,iip1,jjp1,tsea_ice,tsea_iceS) 326 call gr_fi_dyn(1,ngridmx,iip1,jjp1,sea_ice,sea_iceS) 327 call gr_fi_dyn(noceanmx,ngridmx,iip1,jjp1,tslab,tslabS) 328 305 329 c======================================================================= 306 330 c Info pour controler … … 455 479 call write_archive(nid,ntime,'cloudfrac' 456 480 & ,'Cloud fraction','',3,cloudfracS) 481 482 c----------------------------------------------------------------------- 483 c Slab ocean 484 c----------------------------------------------------------------------- 485 OPEN(99,file='callphys.def',status='old',form='formatted' 486 & ,iostat=ierr) 487 CLOSE(99) 488 489 IF(ierr.EQ.0) THEN 490 491 492 write(*,*) "Use slab-ocean ?" 493 ok_slab_ocean=.false. ! default value 494 call getin("ok_slab_ocean",ok_slab_ocean) 495 write(*,*) "ok_slab_ocean = ",ok_slab_ocean 496 497 if(ok_slab_ocean) then 498 call write_archive(nid,ntime,'rnat' 499 & ,'rnat','',2,rnatS) 500 call write_archive(nid,ntime,'pctsrf_sic' 501 & ,'pctsrf_sic','',2,pctsrf_sicS) 502 call write_archive(nid,ntime,'sea_ice' 503 & ,'sea_ice','',2,sea_iceS) 504 call write_archive(nid,ntime,'tslab' 505 & ,'tslab','',3,tslabS) 506 call write_archive(nid,ntime,'tsea_ice' 507 & ,'tsea_ice','',2,tsea_iceS) 508 endif !ok_slab_ocean 509 ENDIF 457 510 c----------------------------------------------------------------------- 458 511 c Fin -
trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90
r1123 r1297 607 607 !======================================================================= 608 608 ! Initialise the continuum absorption data 609 609 if(continuum)then 610 610 do igas=1,ngasmx 611 611 … … 644 644 645 645 enddo 646 endif 646 647 647 648 print*,'----------------------------------------------------' -
trunk/LMDZ.GENERIC/libf/phystd/turbdiff.F90
r1283 r1297 5 5 pdufi,pdvfi,pdtfi,pdqfi,pfluxsrf, & 6 6 Pdudif,pdvdif,pdtdif,pdtsrf,sensibFlux,pq2, & 7 pdqdif,pdqevap,pdqsdif, lastcall)7 pdqdif,pdqevap,pdqsdif,flux_u,flux_v,lastcall) 8 8 9 9 use watercommon_h, only : RLVTT, T_h2O_ice_liq, RCPD, mx_eau_sol,Psat_water … … 65 65 REAL,INTENT(IN) :: pcapcal(ngrid) 66 66 REAL,INTENT(INOUT) :: pq2(ngrid,nlay+1) 67 68 integer,intent(in) :: rnat(ngrid)67 REAL,INTENT(OUT) :: flux_u(ngrid),flux_v(ngrid) 68 REAL,INTENT(IN) :: rnat(ngrid) 69 69 LOGICAL,INTENT(IN) :: lastcall ! not used 70 70 … … 334 334 ENDDO 335 335 336 ! Calcul of wind stress 337 338 DO ig=1,ngrid 339 flux_u(ig) = zfluxv(ig,1)/ptimestep*zu(ig,1) 340 flux_v(ig) = zfluxv(ig,1)/ptimestep*zv(ig,1) 341 ENDDO 336 342 337 343 … … 499 505 ! compute evaporation efficiency 500 506 do ig=1,ngrid 501 if( rnat(ig).eq.1)then507 if(nint(rnat(ig)).eq.1)then 502 508 dryness(ig)=pqsurf(ig,iliq_surf)+pqsurf(ig,iice_surf) 503 509 dryness(ig)=MIN(1.,2*dryness(ig)/mx_eau_sol) … … 601 607 ! The surface vapour tracer is actually liquid. To make things difficult. 602 608 603 if ( rnat(ig).eq.0) then ! unfrozen ocean609 if (nint(rnat(ig)).eq.0) then ! unfrozen ocean 604 610 605 611 pdqsdif(ig,iliq_surf)=dqsdif_total(ig)/ptimestep 606 612 pdqsdif(ig,iice_surf)=0.0 607 613 608 elseif ( rnat(ig).eq.1) then ! (continent)614 elseif (nint(rnat(ig)).eq.1) then ! (continent) 609 615 ! If water is evaporating / subliming, we take it from ice before liquid 610 616 ! -- is this valid?? … … 628 634 endif 629 635 630 elseif ( rnat(ig).eq.2) then ! (continental glaciers)636 elseif (nint(rnat(ig)).eq.2) then ! (continental glaciers) 631 637 pdqsdif(ig,iliq_surf)=0.0 632 638 pdqsdif(ig,iice_surf)=dqsdif_total(ig)/ptimestep -
trunk/LMDZ.GENERIC/libf/phystd/vdifc.F
r952 r1297 57 57 REAL pq2(ngrid,nlay+1) 58 58 59 integerrnat(ngrid)59 real rnat(ngrid) 60 60 61 61 ! Arguments added for condensation … … 512 512 ! compute evaporation efficiency 513 513 do ig = 1, ngrid 514 if( rnat(ig).eq.1)then514 if(nint(rnat(ig)).eq.1)then 515 515 dryness(ig)=pqsurf(ig,ivap)+pqsurf(ig,iice) 516 516 dryness(ig)=MIN(1.,2*dryness(ig)/mx_eau_sol) … … 604 604 ! The surface vapour tracer is actually liquid. To make things difficult. 605 605 606 if ( rnat(ig).eq.0) then ! unfrozen ocean606 if (nint(rnat(ig)).eq.0) then ! unfrozen ocean 607 607 608 608 pdqsdif(ig,ivap)=dqsdif_total(ig)/ptimestep … … 610 610 611 611 612 elseif ( rnat(ig).eq.1) then ! (continent)612 elseif (nint(rnat(ig)).eq.1) then ! (continent) 613 613 614 614 ! --------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.