Commit c2bd55ea authored by Espen Sollum's avatar Espen Sollum
Browse files

Fixed an issue with nested input fields, and nested output fields that have...

Fixed an issue with nested input fields, and nested output fields that have more than 1000 points in x or y (netcdf output)
parent 0c00f1f8
......@@ -818,7 +818,7 @@ contains
allocate(qvhn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,numwfmem,numbnests))
allocate(clwchn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,numwfmem,numbnests))
allocate(ciwchn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,numwfmem,numbnests))
allocate(ctwcn(0:nxmax-1,0:nymax-1,numwfmem,numbnests))
allocate(ctwcn(0:nxmaxn-1,0:nymaxn-1,numwfmem,numbnests))
clwcn(:,:,:,:,:)=0.
ciwcn(:,:,:,:,:)=0.
......
......@@ -1960,7 +1960,7 @@ contains
! For now assume that data at all steps either have or do not have water
if (readclouds) then
j=j+1
call MPI_Irecv(ctwc(:,:,mind),d2s1*5,mp_sp,id_read,MPI_ANY_TAG,&
call MPI_Irecv(ctwc(:,:,mind),d2s1,mp_sp,id_read,MPI_ANY_TAG,&
&MPI_COMM_WORLD,reqs(j),mp_ierr)
if (mp_ierr /= 0) goto 600
end if
......@@ -2325,7 +2325,7 @@ contains
! For now assume that data at all steps either have or do not have water
if (readclouds) then
j=j+1
call MPI_Irecv(ctwcn(:,:,mind,k),d2s1*5,mp_sp,id_read,MPI_ANY_TAG,&
call MPI_Irecv(ctwcn(:,:,mind,k),d2s1,mp_sp,id_read,MPI_ANY_TAG,&
&MPI_COMM_WORLD,reqs(j),mp_ierr)
if (mp_ierr /= 0) goto 600
end if
......
......@@ -271,8 +271,10 @@ subroutine writeheader_netcdf(lnest)
character(len=15) :: units
character(len=10) :: fprefix
character(len=3) :: anspec
character :: adate*8,atime*6,timeunit*32
real, dimension(1000) :: coord
CHARACTER :: adate*8,atime*6,timeunit*32
! ESO DBG: WHY IS THIS HARDCODED TO 1000?
!REAL, DIMENSION(1000) :: coord
real, allocatable, dimension(:) :: coord
integer :: cache_size
integer, dimension(6) :: chunksizes
......@@ -612,27 +614,35 @@ subroutine writeheader_netcdf(lnest)
!******************************
! longitudes (grid cell centers)
if (lnest) then
if (.not.allocated(coord)) allocate(coord(numxgridn))
do i = 1,numxgridn
coord(i) = outlon0n + (i-0.5)*dxoutn
enddo
call nf90_err(nf90_put_var(ncid, lonID, coord(1:numxgridn)))
deallocate(coord)
else
if (.not.allocated(coord)) allocate(coord(numxgrid))
do i = 1,numxgrid
coord(i) = outlon0 + (i-0.5)*dxout
enddo
call nf90_err(nf90_put_var(ncid, lonID, coord(1:numxgrid)))
deallocate(coord)
endif
! latitudes (grid cell centers)
if (lnest) then
if (.not.allocated(coord)) allocate(coord(numygridn))
do i = 1,numygridn
coord(i) = outlat0n + (i-0.5)*dyoutn
enddo
call nf90_err(nf90_put_var(ncid, latID, coord(1:numygridn)))
deallocate(coord)
else
if (.not.allocated(coord)) allocate(coord(numygrid))
do i = 1,numygrid
coord(i) = outlat0 + (i-0.5)*dyout
enddo
call nf90_err(nf90_put_var(ncid, latID, coord(1:numygrid)))
deallocate(coord)
endif
! levels
call nf90_err(nf90_put_var(ncid, levID, outheight(1:numzgrid)))
......
......@@ -152,14 +152,14 @@ module par_mod
! integer,parameter :: nxmax=181,nymax=91,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=0 ! CERA 2.0 degree 92 level
! GFS
! integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0
! integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0
!*********************************************
! Maximum dimensions of the nested input grids
!*********************************************
integer,parameter :: maxnests=0,nxmaxn=451,nymaxn=226
integer,parameter :: maxnests=1,nxmaxn=451,nymaxn=426
! nxmax,nymax maximum dimension of wind fields in x and y
! direction, respectively
......@@ -217,7 +217,7 @@ module par_mod
! Maximum number of particles, species, and similar
!**************************************************
integer,parameter :: maxpart=3000000
integer,parameter :: maxpart=30000000
integer,parameter :: maxspec=6
real,parameter :: minmass=0.0001
......
Markdown is supported
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