PROGRAM xvik USE filtreg_mod, ONLY: inifilr USE comconst_mod, ONLY: dtvr,g,r,pi USE comvert_mod, ONLY: pa,preff IMPLICIT NONE c======================================================================= c c Pressure at Insight and Viking sites c c======================================================================= c----------------------------------------------------------------------- c declarations: c----------------------------------------------------------------------- include "dimensions.h" include "paramet.h" include "comdissip.h" include "comgeom2.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 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 isite(3),jsite(3),ifile(3),iv REAL, PARAMETER :: lonvik1 = -47.95 REAL, PARAMETER :: latvik1 = 22.27 REAL, PARAMETER :: lonvik2 = 134.29 REAL, PARAMETER :: latvik2 = 47.67 REAL, PARAMETER :: loninst = 135.62 REAL, PARAMETER :: latinst = 4.502 REAL, PARAMETER :: phivik1 = -3637 REAL, PARAMETER :: phivik2 = -4505 REAL, PARAMETER :: phiinst = -2614 REAL lonsite(3),latsite(3),phisite(3),phisim(3) 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,3),zalpha,zbeta LOGICAL firstcal INTEGER*4 day0 REAL ziceco2(iip1,jjp1) REAL day,zt,sollong,sol,dayw,dayw_ls 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 INTEGER Time_unit REAL ls2sol c externe: c -------- EXTERNAL iniconst,inigeom,covcont,mywrite EXTERNAL exner,pbar EXTERNAL coordij,moy2 EXTERNAL SSUM REAL SSUM c diurnam: c -------- integer di,di_prev integer k real ps_gcm_diurnal, ps_diurnal integer compt_diurn c harmonics: c -------- integer, parameter :: nbmax = 999999 integer ndata real ls_harm real ls_tab(nbmax) real ps_diurnal_tab(nbmax),ps_gcm_diurnal_tab(nbmax) real a_tab(nbmax),b_tab(nbmax) real a_tab_gcm(nbmax),b_tab_gcm(nbmax) real a,b real ps_harm, ps_gcm_harm integer, parameter :: n_harmo = 6 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c----------------------------------------------------------------------- c initialisations: c----------------------------------------------------------------------- pi=4.*atan(1.) pa=20 preff=610. chr2="0" iyear=0 unanj=669. print*,'WARNING!!! Assuming',unanj,'sols/year' c----------------------------------------------------------------------- c Viking Lander and Insight coordinates: c -------------------------------------------------------------------- lonsite(1) = lonvik1 latsite(1) = latvik1 lonsite(2) = lonvik2 latsite(2) = latvik2 lonsite(3) = loninst latsite(3) = latinst phisite(1) = phivik1 phisite(2) = phivik2 phisite(3) = phiinst WRITE(*,*) 'Viking1 coordinates:' WRITE(*,*) 'latvik1:',latvik1,' lonvik1:',lonvik1 WRITE(*,*) 'Phivik1:', phivik1 WRITE(*,*) 'Viking2 coordinates:' WRITE(*,*) 'latvik2:',latvik2,' lonvik2:',lonvik2 WRITE(*,*) 'Phivik2:', phivik2 WRITE(*,*) 'Insight coordinates:' WRITE(*,*) 'latinst:',latinst,' loninst:',loninst WRITE(*,*) 'Phiinst:', phiinst ! convert coordinates to radians lonsite(1) = lonvik1 * pi/180. latsite(1) = latvik1 * pi/180. lonsite(2) = lonvik2 * pi/180. latsite(2) = latvik2 * pi/180. lonsite(3) = loninst * pi/180. latsite(3) = latinst * pi/180. WRITE(*,*) 'Path to the diagfi files directory' READ (*,'(a)') pathchmp WRITE(*,*) 'Path to the dir for outputs' READ (*,'(a)') pathsor WRITE(*,*) 'Output file time axis in sol (1) '// &'in ls (2) ,or both (3)' READ (*,*) Time_unit write (*,*)'>>>>>>>>>>>>>>>>', phisite,g DO iv=1,3 phisite(iv)=phisite(iv)*3.73 END DO c----------------------------------------------------------------------- c output files: c----------------------------------------------------------------------- ifile(1)=12 ifile(2)=13 ifile(3)=14 kyear=-1 unitlec=11 print*,'diagfi file name (without trailing .nc)' READ(5,'(a)',err=9999) nomfich c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% c loop on the diagfi files: c%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% firstcal=.true. DO WHILE(len_trim(nomfich).GT.0.AND.len_trim(nomfich).LT.50) PRINT *,'>>> nomfich : ',trim(nomfich) c---------------------------------------------------------------------- c Open diagfi files : c---------------------------------------------------------------------- file=pathchmp(1:len_trim(pathchmp))//'/'// s nomfich(1:len_trim(nomfich)) PRINT*,'file.nc: ', file(1:len_trim(file))//'.nc' PRINT*,'timestep ',dtvr ierr= NF_OPEN(file(1:len_trim(file))//'.nc',NF_NOWRITE,nid) c---------------------------------------------------------------------- c initialise physics: c---------------------------------------------------------------------- CALL readhead_NC(file(1:len_trim(file))//'.nc',day0,phis,constR) WRITE (*,*) 'day0 = ' , day0 CALL conf_gcm( 99, .TRUE. ) CALL iniconst CALL inigeom c---------------------------------------------------------------------- c Read time : c---------------------------------------------------------------------- ierr= NF_INQ_DIMID (nid,"Time",dimid) IF (ierr.NE.NF_NOERR) THEN PRINT*, 'xvik: Le champ