Commit facf9681 authored by bjb's avatar bjb
Browse files

Works with An from netcdf file

parent 9080ed91
!$Id: m2d.F90,v 1.28 2009-05-07 16:00:26 kb Exp $
!$Id: m2d.F90,v 1.29 2009-05-12 10:50:44 bjb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -29,6 +29,7 @@
use halo_zones, only : update_2d_halo,wait_halo
use halo_zones, only : U_TAG,V_TAG,H_TAG
use variables_2d
use input, only: get_2d_field
IMPLICIT NONE
!
! !PUBLIC DATA MEMBERS:
......@@ -139,8 +140,7 @@
case(2)
LEVEL2 'An_method=2 -> Using space varying horizontal numerical diffusion'
LEVEL2 '.. will read An from An_file ',trim(An_file)
stop 'not working properly yet'
call get_2d_field("test.nc","An",ilg,ihg,jlg,jhg,An(ill:ihl,jll:jhl))
call get_2d_field(trim(An_file),"An",ilg,ihg,jlg,jhg,An(ill:ihl,jll:jhl))
call update_2d_halo(An,An,az,imin,jmin,imax,jmax,H_TAG)
call wait_halo(H_TAG)
case default
......
!$Id: get_2d_field.F90,v 1.1 2009-05-07 16:02:01 kb Exp $
!$Id: get_2d_field.F90,v 1.2 2009-05-12 10:50:44 bjb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,6 +12,7 @@
! Reads varname from a named file - fn - into to field.
!
! !USES:
use field_2d_ncdf, only: get_2d_field_ncdf
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......
!$Id: input.F90,v 1.5 2009-05-12 07:08:27 kb Exp $
!$Id: input.F90,v 1.6 2009-05-12 10:50:44 bjb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -25,6 +25,9 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: input.F90,v $
! Revision 1.6 2009-05-12 10:50:44 bjb
! Works with An from netcdf file
!
! Revision 1.5 2009-05-12 07:08:27 kb
! added interface for get_2d_field()
!
......@@ -97,7 +100,7 @@
subroutine get_2d_field(fn,varname,il,ih,jl,jh,f)
character(len=*),intent(in) :: fn,varname
integer, intent(in) :: il,ih,jl,jh
REALTYPE, intent(out) :: f
REALTYPE, intent(out) :: f(:,:)
end subroutine get_2d_field
end interface
......
!$Id: get_2d_field_ncdf.F90,v 1.1 2009-05-07 16:02:01 kb Exp $
!$Id: get_2d_field_ncdf.F90,v 1.2 2009-05-12 10:50:44 bjb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: get_2d_field_ncdf()
! !MODULE: field_2d_ncdf - Interface with 2D field from file
!
! !INTERFACE:
subroutine get_2d_field_ncdf(fn,varname,il,ih,jl,jh,field)
module field_2d_ncdf
!
! !DESCRIPTION:
! This module is responsible for reading 2D field quantities
! contained in a netCDF file.
! !USES:
use netcdf
use exceptions
IMPLICIT NONE
!
! !PUBLIC MEMBER FUNCTIONS:
public get_2d_field_ncdf
!
! !PUBLIC DATA MEMBERS:
!
! !DEFINED PARAMETERS:
!
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding, Lars Umlauf
!
!EOP
!
! !LOCAL VARIABLES:
!
!-----------------------------------------------------------------------
contains
!-----------------------------------------------------------------------
!BOP
! !IROUTINE: get_2d_field_ncdf()
!
! !INTERFACE:
subroutine get_2d_field_ncdf(fn,varname,il,ih,jl,jh,field)
! !USES:
IMPLICIT NONE
!
! !DESCRIPTION:
! A two-dimensional netCDF variable with specified global range
! {\tt il < i < ih} and {\tt jl < j < jh} is read into {\tt field}.
......@@ -27,9 +60,6 @@
! !OUTPUT PARAMETERS:
REALTYPE, intent(out) :: field(:,:)
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding, Lars Umlauf
!
! !LOCAL VARIABLES:
integer, dimension(2) :: start
integer, dimension(2) :: edges
......@@ -84,3 +114,5 @@
!-----------------------------------------------------------------------
! Copyright (C) 2009 - Hans Burchard and Karsten Bolding (BB) !
!-----------------------------------------------------------------------
end module field_2d_ncdf
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