Changeset b1e0742 in flexpart.git
- Timestamp:
- Apr 3, 2018, 2:47:07 PM (6 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 8fcfd08
- Parents:
- f4a4339
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/concoutput_mpi.f90
r6a678e3 rb1e0742 113 113 integer :: ierr 114 114 character(LEN=100) :: dates_char 115 ! character :: dates_char116 115 117 116 ! Measure execution time -
src/readOHfield.f90
rd7aab4b rb1e0742 22 22 subroutine readOHfield 23 23 24 !***************************************************************************** 25 ! * 26 ! Reads the OH field into memory * 27 ! * 28 ! AUTHOR: R.L. Thompson, Nov 2014 * 29 ! * 30 !***************************************************************************** 31 ! * 32 ! Variables: * 33 ! * 34 ! path(numpath) contains the path names * 35 ! lonOH(nxOH) longitude of OH fields * 36 ! latOH(nyOH) latitude of OH fields * 37 ! altOH(nzOH) altitude of OH fields * 38 ! etaOH(nzOH) eta-levels of OH fields * 39 ! OH_field(nxOH,nyOH,nzOH,m) OH concentration (molecules/cm3) * 40 ! * 41 ! * 42 !***************************************************************************** 24 !***************************************************************************** 25 ! * 26 ! Reads the OH field into memory * 27 ! * 28 ! AUTHOR: R.L. Thompson, Nov 2014 * 29 ! * 30 ! UPDATES: * 31 ! 03/2018 SEC: Converted original netCDF files to binary format * 32 !***************************************************************************** 33 ! * 34 ! Variables: * 35 ! * 36 ! path(numpath) contains the path names * 37 ! lonOH(nxOH) longitude of OH fields * 38 ! latOH(nyOH) latitude of OH fields * 39 ! altOH(nzOH) altitude of OH fields * 40 ! etaOH(nzOH) eta-levels of OH fields * 41 ! OH_field(nxOH,nyOH,nzOH,m) OH concentration (molecules/cm3) * 42 ! * 43 ! * 44 !***************************************************************************** 43 45 44 46 use oh_mod … … 48 50 implicit none 49 51 50 include 'netcdf.inc'51 52 52 character(len=150) :: thefile 53 53 character(len=2) :: mm 54 54 integer :: nid,ierr,xid,yid,zid,vid,m 55 integer :: i,j,k,l 55 56 real, dimension(:), allocatable :: etaOH 56 57 … … 61 62 real, parameter :: scalehgt=7000. ! scale height in metres 62 63 63 ! Read OH fields and level heights64 !********************************65 64 66 do m=1,12 67 68 ! open netcdf file 69 write(mm,fmt='(i2.2)') m 70 ! thefile=trim(path(1))//'OH_FIELDS/'//'geos-chem.OH.2005'//mm//'01.nc' 71 thefile=trim(ohfields_path)//'OH_FIELDS/'//'geos-chem.OH.2005'//mm//'01.nc' 72 ierr=nf_open(trim(thefile),NF_NOWRITE,nid) 73 if(ierr.ne.0) then 74 write (*,*) 'The OH field at: '//thefile// ' could not be opened' 75 write (*,*) 'please copy the OH fields there, or change the path in the' 76 write (*,*) 'COMMAND namelist!' 77 write(*,*) nf_strerror(ierr) 78 stop 79 endif 65 open(unitOH,file=trim(ohfields_path) & 66 //'OH_FIELDS/OH_variables.bin',status='old', & 67 form='UNFORMATTED', iostat=ierr, convert='little_endian') 80 68 81 ! inquire about variables82 ierr=nf_inq_dimid(nid,'Lon-000',xid)83 if(ierr.ne.0) then84 write(*,*) nf_strerror(ierr)85 stop86 endif87 ierr=nf_inq_dimid(nid,'Lat-000',yid)88 if(ierr.ne.0) then89 write(*,*) nf_strerror(ierr)90 stop91 endif92 ierr=nf_inq_dimid(nid,'Alt-000',zid)93 if(ierr.ne.0) then94 write(*,*) nf_strerror(ierr)95 stop96 endif97 98 if(m.eq.1) then99 100 ! read dimension sizes101 ierr=nf_inq_dimlen(nid,xid,nxOH)102 if(ierr.ne.0) then103 write(*,*) nf_strerror(ierr)104 stop105 endif106 ierr=nf_inq_dimlen(nid,yid,nyOH)107 if(ierr.ne.0) then108 write(*,*) nf_strerror(ierr)109 stop110 endif111 ierr=nf_inq_dimlen(nid,zid,nzOH)112 if(ierr.ne.0) then113 write(*,*) nf_strerror(ierr)114 stop115 endif116 117 ! allocate variables118 allocate(lonOH(nxOH))119 allocate(latOH(nyOH))120 allocate(etaOH(nzOH))121 allocate(altOH(nzOH))122 allocate(OH_field(nxOH,nyOH,nzOH,12))123 allocate(OH_hourly(nxOH,nyOH,nzOH,2))124 125 ! read dimension variables126 ierr=nf_inq_varid(nid,'LON',xid)127 ierr=nf_get_var_real(nid,xid,lonOH)128 if(ierr.ne.0) then129 write(*,*) nf_strerror(ierr)130 stop131 endif132 ierr=nf_inq_varid(nid,'LAT',yid)133 ierr=nf_get_var_real(nid,yid,latOH)134 if(ierr.ne.0) then135 write(*,*) nf_strerror(ierr)136 stop137 endif138 ierr=nf_inq_varid(nid,'ETAC',zid)139 ierr=nf_get_var_real(nid,zid,etaOH)140 if(ierr.ne.0) then141 write(*,*) nf_strerror(ierr)142 stop143 endif144 145 ! convert eta-level to altitude (assume surface pressure of 1010 hPa)146 altOH=log(1010./(etaOH*1010.))*scalehgt147 148 endif ! m.eq.1149 150 ! read OH_field151 ierr=nf_inq_varid(nid,'CHEM-L_S__OH',vid)152 ierr=nf_get_var_real(nid,vid,OH_field(:,:,:,m))153 if(ierr.ne.0) then154 write(*,*) nf_strerror(ierr)155 stop156 endif157 158 ierr=nf_close(nid)159 160 end do161 162 deallocate(etaOH)163 164 ! Read J(O1D) photolysis rates165 !********************************166 167 ! open netcdf file168 ! thefile=trim(path(1))//'OH_FIELDS/jrate_average.nc'169 thefile=trim(ohfields_path)//'OH_FIELDS/jrate_average.nc'170 ierr=nf_open(trim(thefile),NF_NOWRITE,nid)171 69 if(ierr.ne.0) then 172 write(*,*) nf_strerror(ierr)70 write(*,*) 'Cannot read binary OH fields in ',trim(ohfields_path)//'OH_FIELDS/OH_variables.bin' 173 71 stop 174 72 endif 175 73 176 ! read dimension variables 177 ierr=nf_inq_varid(nid,'longitude',xid) 178 ierr=nf_get_var_real(nid,xid,lonjr) 179 if(ierr.ne.0) then 180 write(*,*) nf_strerror(ierr) 181 stop 182 endif 183 ierr=nf_inq_varid(nid,'latitude',yid) 184 ierr=nf_get_var_real(nid,yid,latjr) 185 if(ierr.ne.0) then 186 write(*,*) nf_strerror(ierr) 187 stop 188 endif 74 read(unitOH) nxOH 75 read(unitOH) nyOH 76 read(unitOH) nzOH 77 write(*,*) nxOH,nyOH,nzOH 189 78 190 ! read jrate_average 191 ierr=nf_inq_varid(nid,'jrate',vid)192 ierr=nf_get_var_real(nid,vid,jrate_average)193 if(ierr.ne.0) then194 write(*,*) nf_strerror(ierr)195 stop196 endif79 ! allocate variables 80 allocate(lonOH(nxOH)) 81 allocate(latOH(nyOH)) 82 allocate(etaOH(nzOH)) 83 allocate(altOH(nzOH)) 84 allocate(OH_field(nxOH,nyOH,nzOH,12)) 85 allocate(OH_hourly(nxOH,nyOH,nzOH,2)) 197 86 198 ierr=nf_close(nid) 87 read(unitOH) (lonjr(i),i=1,360) 88 read(unitOH) (latjr(i),i=1,180) 89 read(unitOH) (((jrate_average(i,j,k),i=1,360),j=1,180),k=1,12) 90 read(unitOH) (lonOH(i),i=1,nxOH) 91 read(unitOH) (latOH(i),i=1,nyOH) 92 read(unitOH) (lonOH(i),i=1,nxOH) 199 93 200 return 94 read(unitOH) (altOH(i),i=1,nzOH) 95 read(unitOH) ((((OH_field(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,12) 96 read(unitOH) ((((OH_hourly(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,2) 97 write(*,*) 'nzOH: ',nzOH,(altOH(i),i=1,nzOH) 201 98 202 99 end subroutine readOHfield -
src/timemanager_mpi.f90
rd8eed02 rb1e0742 808 808 call initial_cond_calc(itime+lsynctime,j) 809 809 itra1(j)=-999999999 810 !print*, 'terminated particle ',j,'for age' 810 if (verbosity.gt.0) then 811 print*, 'terminated particle ',j,'for age' 812 endif 811 813 endif 812 814 endif … … 819 821 820 822 821 ! Added by mc: counter of "unstable" particle velocity during a time scale822 ! 823 823 ! Counter of "unstable" particle velocity during a time scale 824 ! of maximumtl=20 minutes (defined in com_mod) 825 !************************************************************ 824 826 total_nan_intl=0 825 827 i_nan=i_nan+1 ! added by mc to count nan during a time of maxtl (i.e. maximum tl fixed here to 20 minutes, see com_mod)
Note: See TracChangeset
for help on using the changeset viewer.