Commit a74a60db authored by kb's avatar kb
Browse files

fixed BIO-restart

parent 829da904
!$Id: create_restart_ncdf.F90,v 1.7 2009-09-25 12:14:56 kb Exp $
!$Id: create_restart_ncdf.F90,v 1.8 2010-01-21 15:46:23 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -24,6 +24,7 @@
use domain, only: imin,imax,jmin,jmax,kmax
use domain, only: vert_cord
#ifdef GETM_BIO
use bio, only: bio_calc
use bio_var, only: numc
#endif
IMPLICIT NONE
......@@ -39,6 +40,9 @@
! Original author(s): Karsten Bolding
!
! $Log: create_restart_ncdf.F90,v $
! Revision 1.8 2010-01-21 15:46:23 kb
! fixed BIO-restart
!
! Revision 1.7 2009-09-25 12:14:56 kb
! INCLUDE_HALOS --> SAVE_HALOS
!
......@@ -92,8 +96,10 @@
if (status .NE. NF90_NOERR) go to 10
#ifdef GETM_BIO
status = nf90_def_dim(ncid, "biodim", numc, biodim_id)
if (status .NE. NF90_NOERR) go to 10
if (bio_calc) then
status = nf90_def_dim(ncid, "biodim", numc, biodim_id)
if (status .NE. NF90_NOERR) go to 10
end if
#endif
status = nf90_def_var(ncid, "loop", nf90_int, loop_id)
......@@ -246,10 +252,12 @@
if (status .NE. NF90_NOERR) go to 10
#endif
#ifdef GETM_BIO
status = nf90_def_var(ncid, "bio", nf90_double, &
(/ xdim_id, ydim_id, zdim_id, biodim_id /), &
if (bio_calc) then
status = nf90_def_var(ncid, "bio", nf90_double, &
(/ biodim_id, xdim_id, ydim_id, zdim_id /), &
bio_id)
if (status .NE. NF90_NOERR) go to 10
if (status .NE. NF90_NOERR) go to 10
end if
#endif
end if
#endif
......
!$Id: open_restart_ncdf.F90,v 1.4 2009-09-23 09:54:53 kb Exp $
!$Id: open_restart_ncdf.F90,v 1.5 2010-01-21 15:46:23 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -16,6 +16,10 @@
! !USES:
use netcdf
use ncdf_restart
#ifdef GETM_BIO
use bio, only: bio_calc
use getm_bio, only: bio_init_method
#endif
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......@@ -28,6 +32,9 @@
! Original author(s): Karsten Bolding
!
! $Log: open_restart_ncdf.F90,v $
! Revision 1.5 2010-01-21 15:46:23 kb
! fixed BIO-restart
!
! Revision 1.4 2009-09-23 09:54:53 kb
! fixed typos in DESCRIPTION
!
......@@ -169,8 +176,10 @@
if (status .NE. NF90_NOERR) go to 10
#endif
#ifdef GETM_BIO
status = nf90_inq_varid(ncid, "bio", bio_id)
if (status .NE. NF90_NOERR) go to 10
if (bio_calc .and. bio_init_method .eq. 0) then
status = nf90_inq_varid(ncid, "bio", bio_id)
if (status .NE. NF90_NOERR) go to 10
end if
#endif
end if
#endif
......
!$Id: read_restart_ncdf.F90,v 1.11 2009-09-25 12:14:56 kb Exp $
!$Id: read_restart_ncdf.F90,v 1.12 2010-01-21 15:46:24 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -37,6 +37,7 @@
#ifdef GETM_BIO
use bio, only: bio_calc
use bio_var, only: numc
use getm_bio, only: bio_init_method
#endif
#ifdef SPM
use suspended_matter
......@@ -56,6 +57,9 @@
! Original author(s): Karsten Bolding
!
! $Log: read_restart_ncdf.F90,v $
! Revision 1.12 2010-01-21 15:46:24 kb
! fixed BIO-restart
!
! Revision 1.11 2009-09-25 12:14:56 kb
! INCLUDE_HALOS --> SAVE_HALOS
!
......@@ -89,13 +93,13 @@
! Revision 1.1 2007-09-21 13:03:42 kbk
! added drop-in NetCDF replacement for binary hotstart file (default is binary)
!
!
! !LOCAL VARIABLES:
integer :: il,ih,iloc,ilen
integer :: jl,jh,jloc,jlen
!EOP
!-----------------------------------------------------------------------
!BOC
status = nf90_get_var(ncid,loop_id,loop)
if (status .NE. NF90_NOERR) go to 10
......@@ -455,12 +459,24 @@
end if
#endif
#ifdef GETM_BIO
if(bio_calc) then
start(4) = 1; edges(4) = numc
if(bio_calc .and. bio_init_method .eq. 0) then
start(1) = 1; edges(1) = numc
#ifdef SAVE_HALOS
STDERR 'needs a fix here - read_restart_ncdf()'
stop
start(2) = il; edges(2) = numc
start(3) = jl; edges(3) = numc
#else
start(2) = il; edges(2) = ih-il+1
start(3) = jl; edges(3) = jh-jl+1
#endif
start(4) = 1; edges(4) = kmax+1
status = &
nf90_get_var(ncid,bio_id,cc3d(iloc:ilen,jloc:jlen,0:kmax,numc), &
start,edges)
nf90_get_var(ncid,bio_id,cc3d(1:numc,iloc:ilen,jloc:jlen,0:kmax),start,edges)
if (status .NE. NF90_NOERR) go to 10
end if
#endif
end if
......
!$Id: write_restart_ncdf.F90,v 1.10 2009-09-25 12:17:26 kb Exp $
!$Id: write_restart_ncdf.F90,v 1.11 2010-01-21 15:46:24 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -44,6 +44,9 @@
! Original author(s): Karsten Bolding
!
! $Log: write_restart_ncdf.F90,v $
! Revision 1.11 2010-01-21 15:46:24 kb
! fixed BIO-restart
!
! Revision 1.10 2009-09-25 12:17:26 kb
! removed undef [IJ]RANGE
!
......@@ -260,11 +263,21 @@
#endif
#ifdef GETM_BIO
if (bio_calc) then
start(4) = 1; edges(4) = numc
start(1) = 1; edges(1) = numc
#ifdef SAVE_HALOS
start(2) = 1; edges(2) = (imax+HALO)-(imin-HALO)+1
start(3) = 1; edges(3) = (jmax+HALO)-(jmin-HALO)+1
#else
start(2) = 1; edges(2) = imax-imin+1
start(3) = 1; edges(3) = jmax-jmin+1
#endif
start(4) = 1; edges(4) = kmax+1
status = &
nf90_put_var(ncid,bio_id,cc3d(IRANGE,JRANGE,0:kmax,numc), &
nf90_put_var(ncid,bio_id,cc3d(1:numc,IRANGE,JRANGE,0:kmax), &
start,edges)
if (status .NE. NF90_NOERR) go to 10
end if
#endif
end if
......
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