Commit ad91838c authored by Karsten Bolding's avatar Karsten Bolding
Browse files

output: now compiles and runs with object oriented field_manager

parent b025a642
......@@ -18,6 +18,7 @@
! in from the library {\tt lib2d.a}.
!
! !USES:
use field_manager
use exceptions
use time, only: julianday,secondsofday
use parameters, only: avmmol
......@@ -105,13 +106,14 @@
! !IROUTINE: init_2d - initialise 2D related stuff.
!
! !INTERFACE:
subroutine init_2d(runtype,timestep,hotstart)
subroutine init_2d(runtype,timestep,hotstart,field_manager)
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: runtype
REALTYPE, intent(in) :: timestep
logical, intent(in) :: hotstart
class (type_field_manager),intent(inout),optional :: field_manager
!
! !INPUT/OUTPUT PARAMETERS:
!
......@@ -149,6 +151,8 @@
dtm = timestep
call field_manager%register('z', 'm', 'sea surface elevation', standard_name='sea surface elevation', data2d=z(I2DFIELD))
#if defined(GETM_PARALLEL) || defined(NO_BAROTROPIC)
! STDERR 'Not calling cfl_check() - GETM_PARALLEL or NO_BAROTROPIC'
! call cfl_check()
......
......@@ -23,6 +23,7 @@
! section \ref{sec-clean-3d} on page \pageref{sec-clean-3d}.
!
! !USES:
use field_manager
use exceptions
use parameters, only: avmmol
use domain, only: openbdy,maxdepth,vert_cord,az
......@@ -85,14 +86,15 @@
! !IROUTINE: init_3d - initialise 3D related stuff \label{sec-init-3d}
!
! !INTERFACE:
subroutine init_3d(runtype,timestep,hotstart)
subroutine init_3d(runtype,timestep,hotstart,field_manager)
!
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: runtype
REALTYPE, intent(in) :: timestep
logical, intent(in) :: hotstart
!
class (type_field_manager),intent(inout),optional :: field_manager
!
! !DESCRIPTION:
! Here, the {\tt m3d} namelist is read from {\tt getm.inp}, and the
......@@ -284,6 +286,14 @@
if (vert_cord .eq. _ADAPTIVE_COORDS_) call preadapt_coordinates(preadapt)
! need to get a variable of type_field_manager already initialized to here
#if 1
call field_manager%register('hn', 'm', 'layer thickness', standard_name='cell_thickness', dimensions=(/id_dim_z/),data3d=hn(I3DFIELD))
#endif
call field_manager%list()
stop '2'
#ifdef DEBUG
write(debug,*) 'Leaving init_3d()'
write(debug,*)
......
......@@ -11,6 +11,10 @@ set(getm_VERSION_MINOR 5)
set(getm_VERSION_PATCH 0)
set(getm_VERSION "${getm_VERSION_MAJOR}.${getm_VERSION_MINOR}.${getm_VERSION_PATCH}")
if(GETM_FLAGS)
add_definitions(${GETM_FLAGS})
endif(GETM_FLAGS)
find_package(Git)
if(GIT_FOUND)
#add_custom_command(OUTPUT git_revision.h
......@@ -101,6 +105,7 @@ elseif(${GETM_COORDINATE_TYPE} STREQUAL "Curvilinear")
endif()
message(${GETM_COORDINATE_TYPE})
# Specify default build type for single-type systems (not VS)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
......@@ -370,6 +375,7 @@ if(GOTM_BASE)
set_property(TARGET 3d APPEND PROPERTY INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gotm_fabm,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
mark_as_advanced(GOTM_PREFIX GOTM_USE_FABM)
#KB add_dependencies(output ${GOTM_LIBRARIES})
add_dependencies(3d ${GOTM_LIBRARIES})
else()
find_package(GOTM REQUIRED)
......@@ -380,7 +386,12 @@ else()
set_property(TARGET 3d APPEND PROPERTY INCLUDE_DIRECTORIES "${FABM_INCLUDE_DIRS}")
endif()
endif()
set_property(TARGET 2d APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
set_property(TARGET 3d getm APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
set_property(TARGET output APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
set_property(TARGET ncdf APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
set_property(TARGET input APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
set_property(TARGET getm APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
# Build GETM executable.
add_executable(getm_exe
......@@ -396,6 +407,7 @@ add_executable(getm_exe
$<TARGET_OBJECTS:futils>
)
set_property(TARGET getm_exe PROPERTY OUTPUT_NAME "getm${exe_id}")
set_property(TARGET getm_exe APPEND PROPERTY INCLUDE_DIRECTORIES "${GOTM_INCLUDE_DIRS}")
target_link_libraries(getm_exe ${GOTM_LIBRARIES} ${NetCDF_LIBRARIES})
if (NetCDF_STATIC_MSVC_BUILD)
......
......@@ -10,6 +10,7 @@
! !DESCRIPTION:
!
! !USES:
use field_manager
IMPLICIT NONE
!
! !PUBLIC DATA MEMBERS:
......@@ -19,6 +20,8 @@
!
! !REVISION HISTORY:
! Original author(s): Karsten Bolding & Hans Burchard
type (type_field_manager),target :: field_manager_
!
!EOP
!-----------------------------------------------------------------------
......@@ -204,7 +207,8 @@
FATAL 'A non valid runtype has been specified.'
stop 'initialise()'
end select
!KB
call init_time(MinN,MaxN)
if(use_epoch) then
LEVEL2 'using "',start,'" as time reference'
......@@ -212,17 +216,19 @@
call init_domain(input_dir)
call field_manager_%initialize((imax+HALO)-(imin-HALO)+1,(jmax+HALO)-(jmin-HALO)+1,kmax+1,prepend_by_default=(/id_dim_lon,id_dim_lat/),append_by_default=(/id_dim_time/))
call init_meteo(hotstart)
#ifndef NO_3D
call init_rivers()
#endif
call init_2d(runtype,timestep,hotstart)
call init_2d(runtype,timestep,hotstart,field_manager_)
#ifndef NO_3D
if (runtype .gt. 1) then
call init_3d(runtype,timestep,hotstart)
call init_3d(runtype,timestep,hotstart,field_manager_)
#ifndef CONSTANT_VISCOSITY
call init_turbulence(60,trim(input_dir) // 'gotmturb.nml',kmax)
#else
......@@ -246,7 +252,7 @@
end if
#endif
call init_output(runid,title,start,runtype,dryrun,myid,MinN,MaxN,save_initial)
!KB call init_output(runid,title,start,runtype,dryrun,myid)
close(NAMLST)
......@@ -305,7 +311,7 @@
#endif
end if
if (.not. dryrun) then
if (save_initial .and. .not. dryrun) then
call do_output(runtype,MinN-1,timestep)
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