Changeset 2824
- Timestamp:
- Nov 18, 2022, 4:46:50 PM (2 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r2823 r2824 3787 3787 Remove the "tracer" (logical) flag as we now always run with at least 3788 3788 one tracer. 3789 3790 == 18/11/2022 == EM 3791 A first step at cleaning/improving the xvik program: updated comments 3792 and changed output yearly dates range to include sol=669.0 (i.e. last 3793 time step of the year). -
trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/xvik.F
r2325 r2824 3 3 USE filtreg_mod, ONLY: inifilr 4 4 USE comconst_mod, ONLY: dtvr,g,r,pi 5 5 USE comvert_mod, ONLY: pa,preff 6 6 7 7 IMPLICIT NONE … … 38 38 CHARACTER*100 varname 39 39 INTEGER ierr,nid,nvarid,dimid 40 LOGICAL nc41 40 INTEGER start_ps(3),start_temp(4),start_co2ice(3) 42 41 INTEGER count_ps(3),count_temp(4),count_co2ice(3) … … 103 102 c initialisations: 104 103 c----------------------------------------------------------------------- 104 pi=4.*atan(1.) 105 pa=20 106 preff=610. 105 107 106 108 chr2="0" 109 iyear=0 107 110 unanj=669. 108 print*,'WARNING!!!',unanj,'Jours/an' 109 nc=.true. 111 print*,'WARNING!!! Assuming',unanj,'sols/year' 112 113 c----------------------------------------------------------------------- 114 c Viking Lander coordinates: 115 c -------------------------------------------------------------------- 116 117 lonvik(1) = lonvik1 118 latvik(1) = latvik1 119 lonvik(2) = lonvik2 120 latvik(2) = latvik2 110 121 111 122 phivik(1) = phivik1 112 123 phivik(2) = phivik2 113 124 114 print *, 'COORDVIKIIIN', latvik, lonvik 115 print*, 'LES PHIVIK', phivik 116 117 118 119 120 121 WRITE(*,*) 'Chemin des fichiers histoires' 125 WRITE(*,*) 'Viking coordinates:' 126 WRITE(*,*) 'latvik:',latvik,' lonvik:',lonvik 127 WRITE(*,*) 'Phivik:', phivik 128 129 ! convert coordinates to radians 130 lonvik(1) = lonvik1 * pi/180. 131 latvik(1) = latvik1 * pi/180. 132 lonvik(2) = lonvik2 * pi/180. 133 latvik(2) = latvik2 * pi/180. 134 135 136 WRITE(*,*) 'Path to the diagfi files directory' 122 137 READ (*,'(a)') pathchmp 123 WRITE(*,*) ' Chemin des fichiers sorties'138 WRITE(*,*) 'Path to the dir for outputs' 124 139 READ (*,'(a)') pathsor 125 140 126 WRITE(*,*) ' Fichiers de sortie en sol (1)127 & ,en ls (2) ,les deux(3)'141 WRITE(*,*) 'Output file time axis in sol (1) '// 142 &'in ls (2) ,or both (3)' 128 143 READ (*,*) Time_unit 129 144 … … 135 150 136 151 c----------------------------------------------------------------------- 137 c ou verture des fichiers xgraph:152 c output files: 138 153 c----------------------------------------------------------------------- 139 154 ifile(1)=12 … … 143 158 144 159 145 print*,' Entrer un fichier NC (sans le.nc)'160 print*,'diagfi file name (without trailing .nc)' 146 161 READ(5,'(a)',err=9999) nomfich 147 162 148 163 149 164 c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 150 c grande boucle sur les fichiers histoire:165 c loop on the diagfi files: 151 166 c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 152 167 … … 164 179 PRINT*,'timestep ',dtvr 165 180 166 IF(nc) THEN167 181 ierr= NF_OPEN(file(1:len_trim(file))//'.nc',NF_NOWRITE,nid) 168 ELSE 169 PRINT*,'Ouverture binaire ',file 170 OPEN(unitlec,file=file,status='old',form='unformatted', 171 . iostat=ierr) 172 ENDIF 173 174 c---------------------------------------------------------------------- 175 c initialisation de la physique: 182 183 c---------------------------------------------------------------------- 184 c initialise physics: 176 185 c---------------------------------------------------------------------- 177 186 … … 211 220 212 221 213 c-----------------------------------------------------------------------214 c coordonnees des point Viking:215 c --------------------------------------------------------------------216 217 lonvik(1) = lonvik1 * pi/180.218 latvik(1) = latvik1 * pi/180.219 lonvik(2) = lonvik2 * pi/180.220 latvik(2) = latvik2 * pi/180.221 222 222 223 223 c---------------------------------------------------------------------- … … 255 255 256 256 c---------------------------------------------------------------------- 257 c altitude reelle et modele aux points Viking257 c true and model altitude at Viking locations 258 258 c---------------------------------------------------------------------- 259 259 … … 269 269 ENDDO 270 270 ENDDO 271 PRINT*,' relief aux points Viking pour les sorties:',phivik271 PRINT*,'phivik at Viking locations for outputs:',phivik 272 272 273 273 274 274 c---------------------------------------------------------------------- 275 c lectures des etats:275 c read variables: 276 276 c ------------------------------------------------------------------- 277 277 … … 294 294 295 295 c---------------------------------------------------------------------- 296 c lecture drs des champs:297 c---------------------------------------------------------------------- 298 299 300 ccccccccc L ECTUREPs ccccccccccccccccccccccccccc296 c read fields: 297 c---------------------------------------------------------------------- 298 299 300 ccccccccc Load Ps ccccccccccccccccccccccccccc 301 301 302 302 … … 314 314 PRINT*,'ps',ps(iip1/2,jjp1/2) 315 315 316 ccccccccc L ECTURETemperature ccccccccccccccccccccccccccc316 ccccccccc Load Temperature ccccccccccccccccccccccccccc 317 317 318 318 … … 353 353 354 354 355 ccccccccc L ECTUREco2ice ccccccccccccccccccccccccccc355 ccccccccc Load co2ice ccccccccccccccccccccccccccc 356 356 357 357 … … 370 370 371 371 c---------------------------------------------------------------------- 372 c Gestion du temps372 c Handle calendar 373 373 c --------------------------------------------------------------------- 374 374 … … 376 376 PRINT*,'day ',day 377 377 sol=day+day0 378 iyear=sol/unanj 379 WRITE (*,*) 'iyear',iyear 380 sol=sol-iyear*unanj 381 382 c---------------------------------------------------------------------- 383 c Ouverture / fermeture des fichiers 378 do while (sol.gt.unanj) 379 sol=sol-unanj 380 enddo 381 WRITE (*,*) 'sol: ',sol,' iyear:',iyear 382 383 c---------------------------------------------------------------------- 384 c Open /close files 384 385 c --------------------------------------------------------------------- 385 386 386 387 IF (iyear.NE.kyear) THEN 387 388 WRITE(chr2(1:1),'(i1)') iyear+1 388 WRITE (*,*) 'iyear bis',iyear 389 WRITE (*,*) 'chr2' 390 WRITE (*,*) chr2 389 WRITE (*,*) 'iyear bis:',iyear 390 WRITE (*,*) 'chr2:',trim(chr2) 391 391 IF(iyear.GE.9) WRITE(chr2,'(i2)') iyear+1 392 392 kyear=iyear … … 417 417 418 418 c---------------------------------------------------------------------- 419 c C alcul de la moyenne de pression planetaire419 c Compute average planetary pressure 420 420 c --------------------------------------------------------------------- 421 421 … … 442 442 443 443 444 c -------------- Ecriture fichier sortie xprestot-----------------------444 c --------------Write output file xprestot----------------------- 445 445 c Sol ou ls ou les deux 446 446 c Ps_moy_planetaire (Pa) … … 465 465 466 466 c---------------------------------------------------------------------- 467 c boucle sur les sites vikings: 468 c---------------------------------------------------------------------- 469 470 c---------------------------------------------------------------------- 471 c interpolation de la temperature dans la 7eme couche, de la pression 472 c de surface et des vents aux points viking. 467 c Loop on Viking sites: 468 c---------------------------------------------------------------------- 469 470 c---------------------------------------------------------------------- 471 c interapolate using temperature in the 7th layer, of surface pressure 473 472 c---------------------------------------------------------------------- 474 473 … … 491 490 zt=zt+zw(ii,jj,iv)*t7(i,j) 492 491 zp1=zp1+zw(ii,jj,iv)*log(ps(i,j)) ! interpolate in log(P) 493 WRITE (*,*) 'ps a utouriv',ps(i,j),iv492 WRITE (*,*) 'ps around iv',ps(i,j),iv 494 493 495 494 ENDDO … … 502 501 503 502 c---------------------------------------------------------------------- 504 c pression au sol extrapolee a partir de la temp. 7eme couche503 c surface pressure extrapolated using temp. from 7th atmospheric layer 505 504 c---------------------------------------------------------------------- 506 505 … … 514 513 WRITE (*,*) 'iv,pstot,zp2, zp1, phivik(iv),phisim(iv),gh' 515 514 WRITE (*,*) iv,pstot*airtot1,zp2,zp1,phivik(iv),phisim(iv),gh 515 WRITE(*,*) "------" 516 516 517 517 518 c ------ Ecriture 2 fichiers (1 pour Vl1, 1 pour VL2) sortiexpsol ------519 c Sol o u ls ou les deux520 c Ps site VLi (i=1,2) a l'altitude GCM(Pa)521 c Ps site VLi (i=1,2) a l'altitude exacte (interpolee)(Pa)518 c ------Write 2 files (1 for Vl1, 1 for VL2) xpsol ------ 519 c Sol or ls or both 520 c Ps site VLi (i=1,2) at GCM altitude (Pa) 521 c Ps site VLi (i=1,2) at true (interpolated) altitude (Pa) 522 522 523 523 IF(Time_unit == 1) THEN … … 537 537 538 538 c====================================================================== 539 c Fin de la boucle sur les etats du fichier histoire:539 c End of loop of variables in the diagfi file 540 540 c====================================================================== 541 541 542 if (sol.ge.unanj-1.e-5) then 543 ! end of year reached (with some roundoff margin) 544 ! increment iyear 545 iyear=iyear+1 546 endif 547 542 548 ENDDO 543 549 544 550 ierr= NF_CLOSE(nid) 545 551 546 PRINT*,' Fin du fichier',nomfich547 print*,'Entrer un nouveau fichier NC548 & (sans le .nc) ou return pour finir'552 PRINT*,'End of file',nomfich 553 print*,'Entrer new file name (without trailing .nc)', 554 &" or return to end" 549 555 READ(5,'(a)',err=9999) nomfich 550 556 551 557 552 558 c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 553 c Fin de la boucle sur les fichiers histoire:559 c End of loop on the diagfi files 554 560 c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 555 561 556 562 ENDDO 557 563 558 PRINT*,' relief du point V1',.001*phis(ivik(1),jvik(1))/g559 PRINT*,' relief du point V2',.001*phis(ivik(2),jvik(2))/g564 PRINT*,'altitude of VL1',.001*phis(ivik(1),jvik(1))/g 565 PRINT*,'altitude of VL2',.001*phis(ivik(2),jvik(2))/g 560 566 DO iv=1,2 561 567 PRINT*,'Viking',iv,' i=',ivik(iv),'j =',jvik(iv) … … 570 576 print*,'zw' 571 577 write(6,'(2(2f10.4/))') ((zw(ii,jj,iv),ii=0,1),jj=0,1) 572 print*,' altitude interpolee (km) ',phisim(iv)/1000./g578 print*,'interpolated altitude (km) ',phisim(iv)/1000./g 573 579 ENDDO 574 580 PRINT*,'R=',r 575 9999 PRINT*,' Fin'581 9999 PRINT*,'End ' 576 582 577 583 7777 FORMAT ('latitude/longitude',4f7.1) … … 659 665 !============================================================================== 660 666 661 count_years=0 ! initialize667 count_years=0 ! initialize 662 668 zz=sol ! use "zz" to store (and work on) the value of sol 663 669 do while (zz.ge.year_day)
Note: See TracChangeset
for help on using the changeset viewer.