PROGRAM xvik IMPLICIT NONE c======================================================================= c c Pression au site Viking c c======================================================================= c----------------------------------------------------------------------- c declarations: c ------------- #include "dimensions.h" #include "paramet.h" #include "comconst.h" #include "comdissip.h" #include "comvert.h" #include "comgeom2.h" #include "logic.h" #include "temps.h" #include "control.h" #include "ener.h" #include "description.h" #include "netcdf.inc" INTEGER itau,nbpas,nbpasmx PARAMETER(nbpasmx=1000000) REAL temps(nbpasmx) INTEGER unitlec INTEGER i,j,l,jj REAL constR c Declarations NCDF: c ----------------- CHARACTER*100 varname INTEGER ierr,nid,nvarid,dimid LOGICAL nc INTEGER start_ps(3),start_temp(4),start_co2ice(3) INTEGER count_ps(3),count_temp(4),count_co2ice(3) c declarations pour les points viking: c ------------------------------------ INTEGER ivik(2),jvik(2),ifile(2),iv REAL lonvik(2),latvik(2),phivik(2),phisim(2) REAL unanj c variables meteo: c ---------------- REAL vnat(iip1,jjm,llm),unat(iip1,jjp1,llm) REAL t(iip1,jjp1,llm),ps(iip1,jjp1),pstot, phis(iip1,jjp1) REAL co2ice(iip1,jjp1), captotN,captotS real t7(iip1,jjp1) ! temperature in 7th atmospheric layer REAL zp1,zp2,zp2_sm,zu,zv,zw(0:1,0:1,2),zalpha,zbeta LOGICAL firstcal,lcal,latcal,lvent,day_ls INTEGER*4 day0 REAL ziceco2(iip1,jjp1) REAL day,zt,sollong,sol,dayw REAL airtot1,gh INTEGER ii,iyear,kyear CHARACTER*2 chr2 c declarations de l'interface avec mywrite: c ----------------------------------------- CHARACTER file*80 CHARACTER pathchmp*80,pathsor*80,nomfich*80 c externe: c -------- EXTERNAL iniconst,inigeom,covcont,mywrite EXTERNAL inifilr,exner,pbar EXTERNAL solarlong,coordij,moy2 EXTERNAL SSUM REAL SSUM EXTERNAL lnblnk INTEGER lnblnk cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c----------------------------------------------------------------------- c initialisations: c ---------------- unanj=667.9 print*,'WARNING!!!',unanj,'Jours/an' nc=.true. lcal=.true. latcal=.true. lvent=.false. day_ls=.true. c lecture du fichier xvik.def phivik(1)=-3627 phivik(2)=-4505 OPEN(99,file='xvik.def',form='formatted') READ(99,*) READ(99,*,iostat=ierr) phivik IF(ierr.NE.0) GOTO 105 READ(99,*,END=105) READ(99,'(a)',END=105) pathchmp READ(99,*,END=105) READ(99,'(a)',END=105) pathsor READ(99,*,END=105) c READ(99,'(l1)',END=105) day_ls READ(99,'(l1)',END=105) READ(99,'(l1)',END=105) lcal READ(99,'(l1)',END=105) READ(99,'(l1)',END=105) lvent READ(99,'(l1)',END=105) READ(99,'(l1)',END=105) latcal 105 CONTINUE CLOSE(99) write (*,*)'>>>>>>>>>>>>>>>>', phivik,g DO iv=1,2 phivik(iv)=phivik(iv)*3.73 END DO write(*,*) ' pathchmp:',trim(pathchmp) write(*,*) ' pathsor:',trim(pathsor) c----------------------------------------------------------------------- c----------------------------------------------------------------------- c ouverture des fichiers xgraph: c ------------------------------ ifile(1)=12 ifile(2)=13 kyear=-1 c OPEN(77,file='xlongday',form='formatted') unitlec=11 c PRINT*,'entrer le nom du fichier NC' READ(5,'(a)') nomfich PRINT *,'nomfich : ',nomfich c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% c grande boucle sur les fichiers histoire: c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% firstcal=.true. DO WHILE(lnblnk(nomfich).GT.0.AND.lnblnk(nomfich).LT.50) PRINT *,'>>> nomfich : ',trim(nomfich) c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% file=pathchmp(1:lnblnk(pathchmp))//'/'// s nomfich(1:lnblnk(nomfich)) PRINT*,'file.nc: ', file(1:lnblnk(file))//'.nc' PRINT*,'timestep ',dtvr IF(nc) THEN ierr= NF_OPEN(file(1:lnblnk(file))//'.nc',NF_NOWRITE,nid) ELSE PRINT*,'Ouverture binaire ',file OPEN(unitlec,file=file,status='old',form='unformatted', . iostat=ierr) ENDIF c---------------------------------------------------------------------- c initialisation de la physique: c ------------------------------ CALL readhead_NC(file(1:lnblnk(file))//'.nc',day0,phis,constR) WRITE (*,*) 'day0 = ' , day0 CALL iniconst CALL inigeom CALL inifilr c Lecture temps : ierr= NF_INQ_DIMID (nid,"Time",dimid) IF (ierr.NE.NF_NOERR) THEN PRINT*, 'xvik: Le champ