subroutine evolch4(ngrid,nlayer,pls,pplev,pdpsrf,zqch4evol) use datafile_mod use comcstfi_mod, only: pi use mod_phys_lmdz_para, only : is_master use tracer_h, only: igcm_ch4_gas, igcm_n2, mmol implicit none !================================================================== ! Purpose ! ------- ! Get tracer fields according to the solar longitude (for 1D purpose for now) ! ! Inputs ! ------ ! pls solar longitude ! pplev pressure ! pdpsrf tendency on pressure ! ! Outputs ! ------- ! zdqch4evol tendency on zqch4 ! Both ! ---- ! ! Authors ! ------- ! Tanguy Bertrand !================================================================== !----------------------------------------------------------------------- ! Arguments INTEGER ngrid, nlayer REAL,INTENT(IN) :: pls REAL,INTENT(IN) :: pplev(ngrid,nlayer+1) ! pressure levels/ REAL,INTENT(IN) :: pdpsrf(ngrid) REAL,INTENT(OUT) :: zqch4evol(nlayer) ! Final tendancy !----------------------------------------------------------------------- ! Local variables LOGICAL,SAVE :: firstcall=.true. !$OMP THREADPRIVATE(firstcall) integer Nfine parameter(Nfine=143) integer ifine character(len=100) :: file_path real,save,allocatable :: lssdat(:) real,save,allocatable :: vmrdat(:) real :: vmrsrf !---------------- INPUT ------------------------------------------------ IF (firstcall) then firstcall=.false. !$OMP MASTER file_path=trim(datadir)//'/cycle_vmrch4.txt' if (is_master) print*,file_path open(222,file=file_path,form='formatted') if(.not.allocated(lssdat)) then allocate(lssdat(Nfine)) endif if(.not.allocated(vmrdat)) then allocate(vmrdat(Nfine)) endif do ifine=1,Nfine read(222,*) lssdat(ifine), vmrdat(ifine) enddo close(222) !$OMP END MASTER !$OMP BARRIER ENDIF CALL interp_line(lssdat,vmrdat,Nfine,pls*180./pi,vmrsrf,1) ! Reconstruct CH4 profile in percent zqch4evol(:)=min(vmrsrf*(pplev(1,1:nlayer)/pplev(1,1))**((16.-28.)/28.),50.) ! Convert in MMR zqch4evol(:)=zqch4evol(:)/100.*mmol(igcm_n2)/mmol(igcm_ch4_gas) end subroutine evolch4