Commit 5c1e7cb5 authored by Espen Sollum's avatar Espen Sollum
Browse files

Bux fixed for 288x192 data

parent 3c830f0f
......@@ -51,7 +51,6 @@ subroutine allocatedumarray1D(ndims,lendim_exp,maxdim)
integer ndims,lendim_exp(maxdim)
if (allocated(dumarray1D)) deallocate(dumarray1D)
!
allocate(dumarray1D(lendim_exp(1)))
if (allocated(istart)) deallocate(istart)
allocate(istart(ndims))
......
......@@ -247,7 +247,7 @@
! stop
!c---------- number of varibles to recover from netcdf file
nvar_exp_in_grid_atm_nc=6
nvar_exp_in_grid_atm_nc=5 !6
!c--------- 1D fields
varnamev(1)='lat'
varnamev(2)='lon'
......@@ -255,14 +255,19 @@
varnamev(3)='PHIS'
varnamev(4)='LANDFRAC'
varnamev(5)='SGH'
varnamev(6)='xv'
! varnamev(6)='xv' ESO: not used
!c--------- read fields & set grid --------------------------------
do i=1,nvar_exp_in_grid_atm_nc
varname=varnamev(i)
call check_variable(varname,fnamenc,maxdim,nf90_double, &
id_var,ndims,id_dim,ierr,ncid)
if (ierr.lt.0) goto 100
if (ierr.lt.0) then
write(*,*) 'eso 1'
write(*,*) 'varname,fnamenc,maxdim,nf90_double, id_var,ndims,id_dim,ierr,ncid', &
varname,fnamenc,maxdim,nf90_double, id_var,ndims,id_dim,ierr,ncid
goto 100
end if
lendim_exp=0
do j = 1, ndims
lendim_exp(j) = lendim(id_dim(j))
......@@ -309,11 +314,23 @@
yaux2in=dumarray1D(lendim_exp(1)) !last point
yaux1in=dumarray1D(1) !first point
ny=nyfieldin
if (ny > nymax) then
write(*,*) 'ERROR: ny > nymax (', ny, nymax, ')'
write(*,*) 'Check par_mod and/or input files. Exiting'
stop
end if
else if (varname.eq.'lon') then
nxfieldin=lendim_exp(1)
xaux2in=dumarray1D(lendim_exp(1)) !last point
xaux1in=dumarray1D(1) !first point
nxfield=nxfieldin
if (nxfield > nxmax) then
write(*,*) 'ERROR: nx > nxmax (', nx, nxmax, ')'
write(*,*) 'Check par_mod and/or input files. Exiting'
stop
end if
!c-------------- now set grid structure --------------
xaux1=xaux1in
......@@ -345,8 +362,11 @@
if (xauxa.lt.0.001) then
nx=nxfield+1 ! field is cyclic
xglobal=.true.
if (abs(nxshift).ge.nx) &
stop 'nxshift in file par_mod is too large'
if (abs(nxshift).ge.nx) then
write(*,*) 'nxshift in file par_mod is too large'
write(*,*) 'nx, nxshift', nx, nxshift
stop
end if
xlon0=xlon0+real(nxshift)*dx
else
nx=nxfield
......@@ -388,7 +408,12 @@
endif
if (nxshift.lt.0) &
stop 'nxshift (par_mod) must not be negative'
if (nxshift.ge.nxfield) stop 'nxshift (par_mod) too large'
if (nxshift.ge.nxfield) then
write(*,*) 'nxshift (par_mod) too large'
write(*,*) 'nxshift,nxfield', nxshift,nxfield
stop
end if
!c--------------- end of horizontal grid structure definitions --------
......@@ -414,7 +439,8 @@
end if
end do
!c------------------ set the grid ---------------------
!c------------------ set the grid ---------------------
print *,'gotgrid',gotgrid
!error message if no fields found with correct first longitude in it
......
......@@ -162,5 +162,5 @@ $(OBJECTS): $(MODOBJS)
$(F90) $(LDFLAGS) $(CMPL) $<
clean:
rm *.o *.mod
\rm *.o *.mod
......@@ -153,14 +153,14 @@ module par_mod
!*********************************************
! integer,parameter :: nxmax=145,nymax=97,nuvzmax=27,nwzmax=27,nzmax=27 !for NorESM with 1.875x2.5 grid: added by mc
! integer,parameter :: nxmax=145,nymax=97,nuvzmax=33,nwzmax=33,nzmax=33 !for NorESM2
! integer,parameter :: nxmax=144,nymax=96,nuvzmax=33,nwzmax=33,nzmax=33 !for NorESM2 eso
integer,parameter :: nxmax=288,nymax=192,nuvzmax=33,nwzmax=33,nzmax=33 !eso: new
integer,parameter :: nxmax=289,nymax=193,nuvzmax=33,nwzmax=33,nzmax=33 !ESO: new
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=61,nwzmax=61,nzmax=61
!integer,parameter :: nxmax=721,nymax=361,nuvzmax=64,nwzmax=64,nzmax=64
!integer,parameter :: nxshift=359 ! for ECMWF
!nteger,parameter :: nxshift=0 ! for GFS
integer,parameter :: nxshift=73 ! added by mc for CAM 4.0 NOTE THAT THE DATA OF CAM 4.0 HAVE LON(1)=0 with 144 nodes of 2.5 degree, therefore we move origin to -177.5.
!integer,parameter :: nxshift=73 ! added by mc for CAM 4.0 NOTE THAT THE DATA OF CAM 4.0 HAVE LON(1)=0 with 144 nodes of 2.5 degree, therefore we move origin to -177.5.
integer,parameter :: nxshift=145 ! ESO: shift origin to -178.75?
integer,parameter :: nconvlevmax = nuvzmax-1
integer,parameter :: na = nconvlevmax+1
......
......@@ -272,8 +272,6 @@ subroutine readcommand
stop
endif
write(*,*) 'bdate', bdate
! Determine kind of dispersion method
!************************************
......@@ -529,8 +527,6 @@ subroutine readcommand
stop
endif
write(*,*) 'bdate', bdate
return
999 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "COMMAND" #### '
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment