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