Commit 65dd04c4 authored by kbk's avatar kbk
Browse files

cleaned code + TABS to spaces

parent df365636
!$Id: get_field_ncdf.F90,v 1.1 2002-05-02 14:01:48 gotm Exp $
!$Id: get_field_ncdf.F90,v 1.2 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -16,19 +16,22 @@
IMPLICIT NONE
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: fname,var
character(len=*), intent(in) :: fname,var
!
! !INPUT/OUTPUT PARAMETERS:
!
! !OUTPUT PARAMETERS:
REALTYPE, intent(out) :: f(I3DFIELD)
REALTYPE, intent(out) :: f(I3DFIELD)
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: get_field_ncdf.F90,v $
! Revision 1.1 2002-05-02 14:01:48 gotm
! Initial revision
! Revision 1.2 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.1.1.1 2002/05/02 14:01:48 gotm
! recovering after CVS crash
!
! Revision 1.3 2001/10/22 08:10:43 bbh
! De-allocate wrk #ifdef FORTRAN90
......@@ -37,9 +40,9 @@
! Added get_field_ncdf() + various small bug fixes
!
! !LOCAL VARIABLES:
integer :: rc,err,ncid,var_id,i,j,k,size,indx
integer :: start(3),edges(3)
REAL_4B, allocatable :: wrk(:)
integer :: rc,err,ncid,var_id,i,j,k,size,indx
integer :: start(3),edges(3)
REAL_4B, allocatable :: wrk(:)
!EOP
!-------------------------------------------------------------------------
!BOC
......
!$Id: ncdf_2d_bdy.F90,v 1.2 2003-04-07 12:49:47 kbk Exp $
!$Id: ncdf_2d_bdy.F90,v 1.3 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -17,19 +17,22 @@
!
private
!
public :: init_2d_bdy_ncdf,do_2d_bdy_ncdf
public :: init_2d_bdy_ncdf,do_2d_bdy_ncdf
!
! !PRIVATE DATA MEMBERS:
integer :: ncid
integer :: time_id,elev_id,nsets,bdy_len
integer :: start(2),edges(2)
REALTYPE :: offset
integer :: ncid
integer :: time_id,elev_id,nsets,bdy_len
integer :: start(2),edges(2)
REALTYPE :: offset
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_2d_bdy.F90,v $
! Revision 1.2 2003-04-07 12:49:47 kbk
! Revision 1.3 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.2 2003/04/07 12:49:47 kbk
! dont need variables_3d
!
! Revision 1.1.1.1 2002/05/02 14:01:46 gotm
......@@ -82,7 +85,7 @@
IMPLICIT NONE
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: fname
character(len=*), intent(in) :: fname
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -94,9 +97,9 @@
! See log for module
!
! !LOCAL VARIABLES:
integer :: err,rec_id,bdy_id
character(len=256) :: units
integer :: j1,s1
integer :: err,rec_id,bdy_id
character(len=256) :: units
integer :: j1,s1
!
!EOP
!-------------------------------------------------------------------------
......@@ -183,7 +186,7 @@
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: loop
integer, intent(in) :: loop
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -193,7 +196,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_2d_bdy.F90,v $
! Revision 1.2 2003-04-07 12:49:47 kbk
! Revision 1.3 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.2 2003/04/07 12:49:47 kbk
! dont need variables_3d
!
! Revision 1.1.1.1 2002/05/02 14:01:46 gotm
......@@ -228,11 +234,11 @@
! Introduced module ncdf_2d_bdy
!
! !LOCAL VARIABLES:
integer,save :: i,n
integer :: err
logical :: first=.true.
REALTYPE :: t
REALTYPE, save :: t1,t2= -_ONE_,loop0
integer,save :: i,n
integer :: err
logical :: first=.true.
REALTYPE :: t
REALTYPE, save :: t1,t2= -_ONE_,loop0
!
!EOP
!-------------------------------------------------------------------------
......@@ -255,7 +261,7 @@
n = size(bdy_times)
do i=1,n
if (bdy_times(i) .gt. real(t + offset)) then
EXIT
EXIT
end if
end do
t1 = bdy_times(i-1) - offset
......@@ -274,7 +280,7 @@
if(t .gt. t2) then
do i=1,n
if(bdy_times(i) .gt. real(t + offset)) then
EXIT
EXIT
end if
end do
t1 = bdy_times(i-1) - offset
......
!$Id: ncdf_3d_bdy.F90,v 1.3 2003-04-07 16:19:52 kbk Exp $
!$Id: ncdf_3d_bdy.F90,v 1.4 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -23,25 +23,28 @@
!
private
!
public :: init_3d_bdy_ncdf,do_3d_bdy_ncdf
public :: init_3d_bdy_ncdf,do_3d_bdy_ncdf
!
! !PRIVATE DATA MEMBERS:
integer :: ncid
integer :: time_id,temp_id,salt_id
integer :: start(4),edges(4)
integer :: time_dim,time_len,bdy_len
logical :: climatology=.false.,from_3d_fields=.false.
REALTYPE :: offset
REAL_4B, allocatable :: bdy_times(:),wrk(:)
REALTYPE, allocatable, dimension(:,:) :: T_old, T_new
REALTYPE, allocatable, dimension(:,:) :: S_old, S_new
REALTYPE, allocatable, dimension(:,:,:) :: T_bdy_clim,S_bdy_clim
integer :: ncid
integer :: time_id,temp_id,salt_id
integer :: start(4),edges(4)
integer :: time_dim,time_len,bdy_len
logical :: climatology=.false.,from_3d_fields=.false.
REALTYPE :: offset
REAL_4B, allocatable :: bdy_times(:),wrk(:)
REALTYPE, allocatable, dimension(:,:) :: T_old, T_new
REALTYPE, allocatable, dimension(:,:) :: S_old, S_new
REALTYPE, allocatable, dimension(:,:,:) :: T_bdy_clim,S_bdy_clim
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_3d_bdy.F90,v $
! Revision 1.3 2003-04-07 16:19:52 kbk
! Revision 1.4 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.3 2003/04/07 16:19:52 kbk
! parallel support
!
! Revision 1.1.1.1 2002/05/02 14:01:49 gotm
......@@ -70,7 +73,7 @@
IMPLICIT NONE
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: fname
character(len=*), intent(in) :: fname
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -82,17 +85,17 @@
! See log for module
!
! !LOCAL VARIABLES:
character(len=256) :: units
integer :: j1,s1
integer :: ndims
integer, allocatable, dimension(:) :: dim_ids,dim_len
character(len=16), allocatable :: dim_name(:)
character(len=256) :: units
integer :: j1,s1
integer :: ndims
integer, allocatable, dimension(:):: dim_ids,dim_len
character(len=16), allocatable :: dim_name(:)
REAL_4B, allocatable, dimension(:,:,:) :: sdum,tdum
REAL_4B, allocatable, dimension(:) :: zlev
REAL_4B, allocatable, dimension(:):: zlev
REAL_4B, allocatable, dimension(:,:,:):: sdum,tdum
integer :: rc,err
integer :: i,j,k,l,n,id
integer :: rc,err
integer :: i,j,k,l,n,id
!EOP
!-------------------------------------------------------------------------
!BOC
......@@ -238,8 +241,8 @@
start(1) = 1; edges(1) = kmax+1;
start(2) = 1; edges(2) = nsbv;
edges(3) = 1
STDERR 'ncdf_init_3d_bdy - not finished yet'
stop
STDERR 'ncdf_init_3d_bdy - not finished yet'
stop
end if
err = nf_close(ncid)
else
......@@ -304,7 +307,7 @@
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: loop
integer, intent(in) :: loop
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -314,7 +317,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_3d_bdy.F90,v $
! Revision 1.3 2003-04-07 16:19:52 kbk
! Revision 1.4 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.3 2003/04/07 16:19:52 kbk
! parallel support
!
! Revision 1.1.1.1 2002/05/02 14:01:49 gotm
......@@ -328,15 +334,15 @@
!
! !LOCAL VARIABLES:
#if 0
integer,save :: i,n
integer,save :: j,k,indx
logical :: first=.true.
REALTYPE :: t
REALTYPE, save :: t1,t2= -_ONE_,loop0
integer,save :: i,n
integer,save :: j,k,indx
logical :: first=.true.
REALTYPE :: t
REALTYPE, save :: t1,t2= -_ONE_,loop0
#endif
integer :: err
REALTYPE :: rat
integer :: monthsecs,prev,this,next
integer :: err
REALTYPE :: rat
integer :: monthsecs,prev,this,next
!EOP
!-------------------------------------------------------------------------
!BOC
......@@ -356,7 +362,7 @@
if (prev .eq. 0) prev=time_len
else
STDERR 'do_3d_bdy_ncdf: climatology time_len .ne. 12'
stop
stop
end if
S_bdy=(1.-rat)*0.5*(S_bdy_clim(prev,:,:)+S_bdy_clim(this,:,:)) &
+ rat*0.5*(S_bdy_clim(next,:,:)+S_bdy_clim(this,:,:))
......
!$Id: ncdf_close.F90,v 1.2 2003-04-07 12:46:06 kbk Exp $
!$Id: ncdf_close.F90,v 1.3 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -27,7 +27,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_close.F90,v $
! Revision 1.2 2003-04-07 12:46:06 kbk
! Revision 1.3 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.2 2003/04/07 12:46:06 kbk
! NO_3D
!
! Revision 1.1.1.1 2002/05/02 14:01:47 gotm
......@@ -40,7 +43,7 @@
! initial import into CVS
!
! !LOCAL VARIABLES:
integer :: err
integer :: err
!EOP
!-----------------------------------------------------------------------
!BOC
......
!$Id: ncdf_common.F90,v 1.1 2002-05-02 14:01:49 gotm Exp $
!$Id: ncdf_common.F90,v 1.2 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -24,8 +24,11 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_common.F90,v $
! Revision 1.1 2002-05-02 14:01:49 gotm
! Initial revision
! Revision 1.2 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.1.1.1 2002/05/02 14:01:49 gotm
! recovering after CVS crash
!
! Revision 1.1 2001/09/13 14:50:02 bbh
! Cleaner and smaller NetCDF implementation + better axis support
......@@ -34,18 +37,18 @@
!EOP
!-----------------------------------------------------------------------
interface
subroutine set_attributes(ncid,id, &
units,long_name, &
valid_min,valid_max,valid_range, &
scale_factor,add_offset, &
FillValue,missing_value, &
C_format,FORTRAN_format)
integer, intent(in) :: ncid,id
character(len=*), optional :: units,long_name
REALTYPE, optional :: valid_min,valid_max,valid_range(2)
REALTYPE, optional :: scale_factor,add_offset
REALTYPE, optional :: FillValue,missing_value
character(len=*), optional :: C_format,FORTRAN_format
subroutine set_attributes(ncid,id, &
units,long_name, &
valid_min,valid_max,valid_range, &
scale_factor,add_offset, &
FillValue,missing_value, &
C_format,FORTRAN_format)
integer, intent(in) :: ncid,id
character(len=*), optional :: units,long_name
REALTYPE, optional :: valid_min,valid_max,valid_range(2)
REALTYPE, optional :: scale_factor,add_offset
REALTYPE, optional :: FillValue,missing_value
character(len=*), optional :: C_format,FORTRAN_format
end subroutine set_attributes
end interface
......
!$Id: ncdf_in.F90,v 1.2 2003-04-07 15:36:08 kbk Exp $
!$Id: ncdf_in.F90,v 1.3 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -18,15 +18,18 @@
public :: get_field_ncdf
!
! !PUBLIC DATA MEMBERS:
integer, public :: ncbathy
integer, public :: h_id,dx_id,dy_id
integer, public :: dims,dimids(2),start(2),edges(2)
integer, public :: ncbathy
integer, public :: h_id,dx_id,dy_id
integer, public :: dims,dimids(2),start(2),edges(2)
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_in.F90,v $
! Revision 1.2 2003-04-07 15:36:08 kbk
! Revision 1.3 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.2 2003/04/07 15:36:08 kbk
! not including interface for get_bathymetry
!
! Revision 1.1.1.1 2002/05/02 14:01:47 gotm
......@@ -56,30 +59,30 @@
interface
#ifdef STATIC
subroutine get_dimensions(fname,rc)
character(len=*), intent(in) :: fname
integer,intent(out) :: rc
character(len=*), intent(in) :: fname
integer,intent(out) :: rc
#else
subroutine get_dimensions(fname,iextr,jextr,rc)
character(len=*), intent(in) :: fname
integer,intent(out) :: iextr,jextr,rc
character(len=*), intent(in) :: fname
integer,intent(out) :: iextr,jextr,rc
#endif
end subroutine get_dimensions
end interface
#if 0
interface
subroutine get_bathymetry(H,Hland,dx,dy,imin,imax,jmin,jmax,rc)
integer, intent(inout) :: imin,imax,jmin,jmax
REALTYPE, intent(out) :: H(E2DFIELD)
REALTYPE, intent(out) :: Hland,dx,dy
integer, intent(out) :: rc
integer, intent(inout) :: imin,imax,jmin,jmax
REALTYPE, intent(out) :: H(E2DFIELD)
REALTYPE, intent(out) :: Hland,dx,dy
integer, intent(out) :: rc
end subroutine get_bathymetry
end interface
#endif
interface
subroutine get_field_ncdf(fname,var,f)
character(len=*), intent(in) :: fname,var
REALTYPE, intent(out) :: f
character(len=*), intent(in) :: fname,var
REALTYPE, intent(out) :: f
end subroutine get_field_ncdf
end interface
......
!$Id: ncdf_rivers.F90,v 1.1 2002-05-02 14:01:48 gotm Exp $
!$Id: ncdf_rivers.F90,v 1.2 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -19,27 +19,29 @@
private
!
! !PUBLIC MEMBER FUNCTIONS:
public init_river_input_ncdf,get_river_data_ncdf
public init_river_input_ncdf,get_river_data_ncdf
!
! !PRIVATE DATA MEMBERS:
REALTYPE :: offset
integer :: ncid,ndims,dims(2),unlimdimid,textr
integer :: start(1),edges(1)
integer :: timedim,time_id
integer, allocatable :: r_ids(:)
REAL_4B, allocatable :: river_times(:)
REALTYPE :: offset
integer :: ncid,ndims,dims(2),unlimdimid,textr
integer :: start(1),edges(1)
integer :: timedim,time_id
integer, allocatable :: r_ids(:)
REAL_4B, allocatable :: river_times(:)
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_rivers.F90,v $
! Revision 1.1 2002-05-02 14:01:48 gotm
! Initial revision
! Revision 1.2 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.1.1.1 2002/05/02 14:01:48 gotm
! recovering after CVS crash
!
! Revision 1.1 2001/10/07 14:50:22 bbh
! Reading river data implemented - NetCFD
!
!
! !TO DO:
!EOP
!-----------------------------------------------------------------------
......@@ -58,8 +60,8 @@
! !DESCRIPTION:
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: fn
integer, intent(in) :: nstart
character(len=*), intent(in) :: fn
integer, intent(in) :: nstart
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -70,10 +72,10 @@
! See module for log.
!
! !LOCAL VARIABLES:
integer :: i,j,n
integer :: err
integer :: j1,s1,j2,s2
character(len=256) :: time_units
integer :: i,j,n
integer :: err
integer :: j1,s1,j2,s2
character(len=256) :: time_units
!EOP
!-------------------------------------------------------------------------
include "netcdf.inc"
......@@ -152,7 +154,7 @@
! !DESCRIPTION:
!
! !INPUT PARAMETERS:
integer, intent(in) :: loop
integer, intent(in) :: loop
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -163,12 +165,12 @@
! See module for log.
!
! !LOCAL VARIABLES:
integer :: i,n,indx,err
REALTYPE :: t
REAL_4B :: x(1)
logical, save :: first=.true.
integer, save :: save_n=1,last_indx=-1
REALTYPE, save :: t_1,t_2
integer :: i,n,indx,err
REALTYPE :: t
REAL_4B :: x(1)
logical, save :: first=.true.
integer, save :: save_n=1,last_indx=-1
REALTYPE, save :: t_1,t_2
!EOP
!-------------------------------------------------------------------------
include "netcdf.inc"
......
!$Id: ncdf_topo.F90,v 1.2 2003-04-07 12:39:59 kbk Exp $
!$Id: ncdf_topo.F90,v 1.3 2003-04-23 11:54:03 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -19,22 +19,25 @@
implicit none
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: fname
character(len=*), intent(in) :: fname
!
! !INPUT/OUTPUT PARAMETERS:
!
! !OUTPUT PARAMETERS:
#ifdef STATIC
integer,intent(out) :: rc
integer,intent(out) :: rc
#else
integer,intent(out) :: iextr,jextr,rc
integer,intent(out) :: iextr,jextr,rc
#endif
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_topo.F90,v $
! Revision 1.2 2003-04-07 12:39:59 kbk
! Revision 1.3 2003-04-23 11:54:03 kbk
! cleaned code + TABS to spaces
!
! Revision 1.2 2003/04/07 12:39:59 kbk
! parallel support
!
! Revision 1.1.1.1 2002/05/02 14:01:47 gotm
......@@ -56,7 +59,7 @@
! initial import into CVS
!
! !LOCAL VARIABLES:
integer :: err
integer :: err
!
!EOP
!-------------------------------------------------------------------------
......@@ -130,26 +133,26 @@
! !DESCRIPTION:
! !INPUT PARAMETERS:
integer, intent(in) :: iextr,jextr,ioff,joff
integer, intent(in) :: imin,imax,jmin,jmax
integer, intent(in) :: iextr,jextr,ioff,joff
integer, intent(in) :: imin,imax,jmin,jmax
!
! !INPUT/OUTPUT PARAMETERS:
!
! !OUTPUT PARAMETERS:
REALTYPE, intent(out) :: H(E2DFIELD)
REALTYPE, intent(out) :: Hland
integer, intent(out) :: rc
REALTYPE, intent(out) :: H(E2DFIELD)
REALTYPE, intent(out) :: Hland
integer, intent(out) :: rc
!
! !REVISION HISTORY:
!
! 22Apr99 Karsten Bolding & Hans Burchard Initial code.
!
! !LOCAL VARIABLES: