Changeset 3195 for trunk/LMDZ.PLUTO/libf/dynphy_lonlat
- Timestamp:
- Jan 31, 2024, 4:36:51 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/lect_start_archive.F
r3184 r3195 7 7 8 8 USE comsoil_h, ONLY: nsoilmx, layer, mlayer, volcapa, inertiedat 9 USE tracer_h, ONLY: igcm_ n2_ice9 USE tracer_h, ONLY: igcm_haze 10 10 USE infotrac, ONLY: tname, nqtot 11 11 ! USE slab_ice_h, ONLY: noceanmx … … 39 39 40 40 41 c Variables pour les lectures des fichiers "ini" 41 c Variables pour les lectures des fichiers "ini" 42 42 c-------------------------------------------------- 43 43 ! INTEGER sizei, … … 53 53 ! character (len=50) :: tmpname 54 54 55 c Variable histoire 55 c Variable histoire 56 56 c------------------ 57 57 REAL,INTENT(OUT) :: vcov(iip1,jjm,llm),ucov(iip1,jjp1,llm) ! vents covariants … … 59 59 REAL,INTENT(OUT) :: q(iip1,jjp1,llm,nqtot) 60 60 61 c Physique sur grille scalaire 61 c Physique sur grille scalaire 62 62 c---------------------------- 63 63 … … 112 112 113 113 114 c Variable de l'ancienne grille 114 c Variable de l'ancienne grille 115 115 c--------------------------------------------------------- 116 116 … … 150 150 logical :: therminertia_3D=.true. ! flag 151 151 ! therminertia_3D=.true. if thermal inertia is 3D and read from datafile 152 c Variable intermediaires iutilise pour l'extrapolation verticale 152 c Variable intermediaires iutilise pour l'extrapolation verticale 153 153 c---------------------------------------------------------------- 154 real, dimension(:,:,:), allocatable :: var,varp1 154 real, dimension(:,:,:), allocatable :: var,varp1 155 155 real, dimension(:), allocatable :: oldgrid, oldval 156 156 real, dimension(:), allocatable :: newval … … 158 158 real,intent(out) :: surfith(iip1,jjp1) ! surface thermal inertia 159 159 ! surface thermal inertia at old horizontal grid resolution 160 real, dimension(:,:), allocatable :: surfithold 160 real, dimension(:,:), allocatable :: surfithold 161 161 162 162 character(len=30) :: txt ! to store some text … … 172 172 !----------------------------------------------------------------------- 173 173 174 ! 1.2 Read the various dimension lengths of data in file 174 ! 1.2 Read the various dimension lengths of data in file 175 175 176 176 ierr= NF_INQ_DIMID(nid,"Time",dimid) … … 245 245 246 246 ! 1.3 Report dimensions 247 247 248 248 write(*,*) "Start_archive dimensions:" 249 249 write(*,*) "longitude: ",imold … … 259 259 endif 260 260 write(*,*) "time lenght: ",timelen 261 write(*,*) 261 write(*,*) 262 262 263 263 !----------------------------------------------------------------------- … … 311 311 312 312 C----------------------------------------------------------------------- 313 c 3.1. Lecture du tableau des parametres du run 313 c 3.1. Lecture du tableau des parametres du run 314 314 c (pour la lecture ulterieure de "ptotalold" et "n2icetotalold") 315 315 c----------------------------------------------------------------------- … … 355 355 PRINT*, "lect_start_archive: Field <rlatu> not found" 356 356 CALL abort 357 ENDIF 357 ENDIF 358 358 #ifdef NC_DOUBLE 359 359 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, rlatuold) … … 440 440 c 3.4 Read Soil layers depths 441 441 c----------------------------------------------------------------------- 442 442 443 443 ierr=NF_INQ_VARID(nid,"soildepth",nvarid) 444 444 if (ierr.ne.NF_NOERR) then … … 540 540 ptotalold = tab_cntrl(tab0+49) 541 541 n2icetotalold = tab_cntrl(tab0+50) 542 542 543 543 c----------------------------------------------------------------------- 544 544 c 4. Lecture du temps et choix 545 545 c----------------------------------------------------------------------- 546 546 547 547 c lecture du temps 548 548 c … … 559 559 IF (ierr .NE. NF_NOERR) THEN 560 560 ierr = NF_INQ_VARID (nid, "temps", nvarid) 561 endif 561 endif 562 562 #ifdef NC_DOUBLE 563 563 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, timelist) … … 584 584 585 585 6 FORMAT(i7,i7,f9.3) 586 586 587 587 write(*,*) 588 588 write(*,*) 'Choice for the date' … … 595 595 endif 596 596 end do 597 597 598 598 if (memo.eq.0) then 599 599 write(*,*) … … 618 618 c 5.1 Lecture des champs 2D (n2ice, emis,ps,tsurf,Tg[10], qsurf) 619 619 c----------------------------------------------------------------------- 620 620 621 621 start=(/1,1,memo,0/) 622 622 count=(/imold+1,jmold+1,1,0/) 623 623 624 624 ierr = NF_INQ_VARID (nid, "emis", nvarid) 625 625 IF (ierr .NE. NF_NOERR) THEN … … 756 756 ! PRINT*, "lect_start_archive: Failed loading <sea_ice>" 757 757 ! ENDIF 758 758 759 759 ! ENDIF! ok_slab_ocean 760 760 c … … 763 763 write(*,*) 764 764 765 ! Surface tracers: 765 ! Surface tracers: 766 766 ! initialize all surface tracers to zero 767 767 qsurfold(1:imold+1,1:jmold+1,1:nqtot)=0 … … 777 777 endif 778 778 779 779 780 780 write(*,*) "lect_start_archive: loading tracer ",trim(txt) 781 781 ierr = NF_INQ_VARID (nid,txt,nvarid) … … 838 838 c 839 839 enddo ! of do isoil=1,nsoilold 840 840 841 841 ! reset 'start' and 'count' to "3D" behaviour 842 842 start=(/1,1,1,memo/) 843 843 count=(/imold+1,jmold+1,nsoilold,1/) 844 844 845 845 else 846 846 write(*,*) "lect_start_archive: loading tsoil " … … 856 856 #endif 857 857 endif ! of if (ierr.ne.NF_NOERR) 858 858 859 859 endif ! of if (olddepthdef) 860 860 … … 928 928 c 929 929 930 ! Tracers: 930 ! Tracers: 931 931 qold(1:imold+1,1:jmold+1,1:lmold,1:nqtot)=0. 932 932 … … 1040 1040 c INTERPOLATION DANS LA NOUVELLE GRILLE et initialisation des variables 1041 1041 c======================================================================= 1042 c Interpolation horizontale puis passage dans la grille physique pour 1043 c les variables physique 1042 c Interpolation horizontale puis passage dans la grille physique pour 1043 c les variables physique 1044 1044 c Interpolation verticale puis horizontale pour chaque variable 3D 1045 1045 c======================================================================= … … 1048 1048 c 6.1 Variable 2d : 1049 1049 c----------------------------------------------------------------------- 1050 c Relief 1050 c Relief 1051 1051 call interp_horiz (phisold,phisold_newgrid,imold,jmold,iim,jjm,1, 1052 1052 & rlonuold,rlatvold,rlonu,rlatv) 1053 1053 1054 ! N2 ice is now in qsurf(igcm_ n2_ice)1054 ! N2 ice is now in qsurf(igcm_haze) 1055 1055 ! call interp_horiz (n2iceold,n2ices,imold,jmold,iim,jjm,1, 1056 1056 ! & rlonuold,rlatvold,rlonu,rlatv) … … 1088 1088 c On assure la conservation de la masse de l'atmosphere + calottes 1089 1089 c----------------------------------------------------------------------- 1090 !AF: TODO: mass conservation: check this. haze? 1090 1091 1091 1092 ptotal = 0. … … 1096 1097 END DO 1097 1098 n2icetotal = 0. 1098 if (igcm_ n2_ice.ne.0) then1099 if (igcm_haze.ne.0) then 1099 1100 ! recast surface N2 ice on new grid 1100 call interp_horiz(qsurfold(1,1,igcm_ n2_ice),1101 & qsurfs(1,1,igcm_ n2_ice),1101 call interp_horiz(qsurfold(1,1,igcm_haze), 1102 & qsurfs(1,1,igcm_haze), 1102 1103 & imold,jmold,iim,jjm,1, 1103 1104 & rlonuold,rlatvold,rlonu,rlatv) … … 1105 1106 DO i=1,iim 1106 1107 !n2icetotal = n2icetotal + n2iceS(i,j)*aire(i,j) 1107 n2icetotal=n2icetotal+qsurfS(i,j,igcm_ n2_ice)*aire(i,j)1108 n2icetotal=n2icetotal+qsurfS(i,j,igcm_haze)*aire(i,j) 1108 1109 END DO 1109 1110 END DO … … 1115 1116 write(*,*)'Old grid: atmospheric mass :',ptotalold 1116 1117 write(*,*)'New grid: atmospheric mass :',ptotal 1117 write (*,*) 'Ratio new atm./ old atm =', ptotal/ptotalold 1118 write (*,*) 'Ratio new atm./ old atm =', ptotal/ptotalold 1118 1119 write(*,*) 1119 1120 write(*,*)'Old grid: mass of N2 ice:',n2icetotalold … … 1131 1132 END DO 1132 1133 1133 if ( n2icetotalold.gt.0.) then 1134 if ( n2icetotalold.gt.0.) then 1134 1135 ! DO j=1,jjp1 1135 1136 ! DO i=1,iip1 … … 1157 1158 &f soil thermal inertia; might be wiser to reset it.' 1158 1159 write(*,*) 1159 1160 1160 1161 do i=1,imold+1 1161 1162 do j=1,jmold+1 … … 1177 1178 ! We have inertiedatold 1178 1179 if((imold.ne.iim).or.(jmold.ne.jjm)) then 1179 write(*,*)'lect_start_archive: WARNING: horizontal interpolation 1180 write(*,*)'lect_start_archive: WARNING: horizontal interpolation 1180 1181 &of thermal inertia; might be better to reset it.' 1181 1182 write(*,*) 1182 1183 endif 1183 1184 1184 1185 ! Do horizontal interpolation 1185 1186 if (depthinterpol) then … … 1210 1211 call gr_dyn_fi (nsoilmx,iim+1,jjm+1,ngrid, 1211 1212 & inertiedatS,inertiedat) 1212 1213 1213 1214 c----------------------------------------------------------------------- 1214 1215 c 6.2.2 Soil temperature … … 1282 1283 deallocate(oldval) 1283 1284 deallocate(newval) 1284 1285 1285 1286 else 1286 1287 tsoiloldnew(:,:,:)=tsoilold(:,:,:) … … 1303 1304 c 6.4 Variable 3d : 1304 1305 c----------------------------------------------------------------------- 1305 1306 1306 1307 c temperatures atmospheriques 1307 1308 write (*,*) 'lect_start_archive: told ', told (1,jmold+1,1) ! INFO … … 1321 1322 & rlonuold,rlatvold,rlonu,rlatv) 1322 1323 call gr_dyn_fi(llm,iim+1,jjm+1,ngrid,du_nonoro_gwdS,du_nonoro_gwd) 1323 1324 1324 1325 call interp_vert 1325 1326 & (dv_nonoro_gwdold,var,lmold,llm,apsold,bpsold,aps,bps, … … 1328 1329 & rlonuold,rlatvold,rlonu,rlatv) 1329 1330 call gr_dyn_fi(llm,iim+1,jjm+1,ngrid,dv_nonoro_gwdS,dv_nonoro_gwd) 1330 1331 1331 1332 call interp_vert 1332 1333 & (east_gwstressold,var,lmold,llm,apsold,bpsold,aps,bps, … … 1335 1336 & rlonuold,rlatvold,rlonu,rlatv) 1336 1337 call gr_dyn_fi(llm,iim+1,jjm+1,ngrid,east_gwstressS,east_gwstress) 1337 1338 1338 1339 call interp_vert 1339 1340 & (west_gwstressold,var,lmold,llm,apsold,bpsold,aps,bps, … … 1379 1380 end do 1380 1381 end do 1381 end do 1382 end do 1382 1383 write (*,*) 'lect_start_archive: ucov ', ucov (1,2,1) ! INFO 1383 1384 c write(48,*) 'ucov',ucov … … 1410 1411 & rlonuold,rlatvold,rlonu,rlatv) 1411 1412 enddo 1412 cccccccccccccccccccccccccccccc 1413 c make sure that sum of q = 1 1414 c dominent species is = 1 - sum(all other species) 1415 cccccccccccccccccccccccccccccc 1413 cccccccccccccccccccccccccccccc 1414 c make sure that sum of q = 1 1415 c dominent species is = 1 - sum(all other species) 1416 cccccccccccccccccccccccccccccc 1416 1417 c iqmax=1 1417 c 1418 c 1418 1419 c if (nqold.gt.10) then 1419 1420 c do l=1,llm … … 1428 1429 c qtot(i,j,l)=0 1429 1430 c do iq=1,nqold 1430 c if (iq.ne.iqmax) then 1431 c q(i,j,l,iqmax)=q(i,j,l,iqmax)-q(i,j,l,iq) 1431 c if (iq.ne.iqmax) then 1432 c q(i,j,l,iqmax)=q(i,j,l,iqmax)-q(i,j,l,iq) 1432 1433 c endif 1433 1434 c enddo !iq … … 1437 1438 c $ qtot(i,j,l) 1438 1439 c enddo !iq 1439 c enddo !i 1440 c enddo !j 1441 c enddo !l 1440 c enddo !i 1441 c enddo !j 1442 c enddo !l 1442 1443 c endif 1443 1444 ccccccccccccccccccccccccccccccc … … 1451 1452 end do 1452 1453 enddo 1453 1454 1454 1455 ! call gr_dyn_fi (1,iim+1,jjm+1,ngrid,n2ices,n2ice) 1455 ! no need to transfer "n2ice" any more; it is in qsurf(igcm_ n2_ice)1456 ! no need to transfer "n2ice" any more; it is in qsurf(igcm_haze) 1456 1457 1457 1458 endif !! if nqtot .ne. 0
Note: See TracChangeset
for help on using the changeset viewer.
