Skip to content

Commit

Permalink
Merge pull request #4 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
Adding GOCART2G to main
  • Loading branch information
WilliamJamieson authored Sep 3, 2020
2 parents d82885e + e759e87 commit 86a7354
Show file tree
Hide file tree
Showing 745 changed files with 125,431 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/cmake@/
/ESMF/Shared/MAPL@/
/cmake-build-debug/
/build/
/.mepo/
/.idea/
/ESMF/Shared/GMAO_Shared@/
/ESMF/Shared/NCEP_Shared@/
/ESMF/HEMCO_GridComp@/
/install/
tags

.DS_STORE
Empty file added CCPP/GOCART_CCPP.F90
Empty file.
50 changes: 50 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
cmake_minimum_required (VERSION 3.17)
cmake_policy (SET CMP0053 NEW)
cmake_policy (SET CMP0054 NEW)

project (
GOCART
VERSION 0.9.0
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

if ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(SEND_ERROR "In-source builds are disabled. Please
issue cmake command in separate build directory.")
endif ("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")

# Set the default build type to release
if (NOT CMAKE_BUILD_TYPE)
message (STATUS "Setting build type to 'Release' as none was specified.")
set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif ()

set (DOING_GEOS5 YES)

# Should find a better place for this - used in Chem component
set (ACG_FLAGS -v)
set (FV_PRECISION R4R8)

if (NOT COMMAND esma)
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake@")
include (esma)
endif()

ecbuild_declare_project()

# This is a KLUDGE to emulate paths used in GEOSgcm so that GOCART Legacy code generation works
file (MAKE_DIRECTORY ${esma_include}/GEOSchem_GridComp)

# Generic DFLAGS
# These should be relocated and/or eliminated.
add_definitions(-Dsys${CMAKE_SYSTEM_NAME} -DESMA64)
add_definitions(${MPI_Fortran_COMPILE_FLAGS})
include_directories(${MPI_Fortran_INCLUDE_PATH})

# Recursively build source tree
add_subdirectory (ESMF)
add_subdirectory (Process_Library)

ecbuild_install_project (NAME GOCART)
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#include "MAPL_Generic.h"

module AeroCinderella_GridCompMod
use ESMF
use MAPL

implicit none
private

public SetServices

type AeroCinderella_GridComp
integer :: nbins
end type AeroCinderella_GridComp

contains
subroutine SetServices(gc, rc)
type(ESMF_GridComp), intent(inout) :: gc
integer, optional, intent( out) :: rc

type(AeroCinderella_GridComp), pointer :: self

character(len=ESMF_MAXSTR) :: comp_name

__Iam__('SetServices')

call ESMF_GridCompGet(gc, name=comp_name, __RC__)
Iam = trim(comp_name) //'::'// Iam

call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_INITIALIZE, Initialize, __RC__)
call MAPL_GridCompSetEntryPoint(gc, ESMF_METHOD_RUN, Run, __RC__)

#include "AeroCinderella_Internal___.h"
#include "AeroCinderella_Export___.h"
#include "AeroCinderella_Import___.h"

call MAPL_GenericSetServices(gc, __RC__)

_RETURN(_SUCCESS)
end subroutine SetServices

subroutine Initialize(gc, import, export, clock, rc)
type(ESMF_GridComp), intent(inout) :: gc
type(ESMF_State), intent(inout) :: import
type(ESMF_State), intent(inout) :: export
type(ESMF_Clock), intent(inout) :: clock
integer, optional, intent( out) :: rc

character(len=ESMF_MAXSTR) :: comp_name

type(MAPL_MetaComp), pointer :: MAPL

__Iam__('Initialize')

call ESMF_GridCompGet(gc, name=comp_name, __RC__)
Iam = trim(comp_name) //'::'// Iam

call MAPL_GetObjectFromgc(gc, MAPL, __RC__)

_RETURN(_SUCCESS)
end subroutine Initialize

subroutine Run(gc, import, export, clock, rc)
type(ESMF_GridComp), intent(inout) :: gc
type(ESMF_State), intent(inout) :: import
type(ESMF_State), intent(inout) :: export
type(ESMF_Clock), intent(inout) :: clock
integer, optional, intent( out) :: rc

character(len=ESMF_MAXSTR) :: comp_name

type(MAPL_MetaComp), pointer :: MAPL

#include "AeroCinderella_DeclarePointer___.h"

__Iam__('Run')

call ESMF_GridCompGet(gc, name=comp_name, __RC__)
Iam = trim(comp_name) //'::'// Iam

call MAPL_GetObjectFromgc(gc, MAPL, __RC__)

_RETURN(_SUCCESS)
end subroutine Run
end module AeroCinderella_GridCompMod
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
schema_version: 2.0.0
component: AeroCinderella

category: IMPORT
#----------------------------------------------------------------------------------------
# VARIABLE | DIMENSIONS| Additional Metadata
#----------------------------------------------------------------------------------------
NAME | UNITS | DIMS | VLOC| COND | LONG NAME
#----------------------------------------------------------------------------------------
DU_SRC | 1 | xy | N | | erod
FRLAKE | 1 | xy | N | | fraction_of_lake
WET1 | 1 | xy | N | | surface_soil_wetness
LWI | 1 | xy | N | | land-ocean-ice_mask
U10M | m s-1 | xy | N | | 10-meter_eastward_wind
V10M | m s-1 | xy | N | | 10-meter_northward_wind
AREA | m^2 | xy | N | | agrid_cell_area
USTAR | m s-1 | xy | N | | equivalent_neutral_10-meter_northward_wind
CN_PRCP |kg/m^2/s| xy | N | | surface_conv._rain_flux_needed_by_land
NCN_PRCP |kg/m^2/s| xy | N | | Non-convective precipitation
ZPBL | m | xy | N | | planetary_boundary_layer_height
SH | w m-2 | xy | N | | sensible_heat_flux_from_turbulence
Z0H | m | xy | N | | surface_roughness_for_heat
#........................................................................................
DELP | Pa | xyz | C | | pressure_thickness
RH2 | 1 | xyz | C | | Rel_Hum_after_moist
T | K | xyz | C | | air_temperature
ZLE | m | xyz | E | | geopotential_height
PLE | Pa | xyz | E | | air_pressure
PFL_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_liquid_nonconvective_precipitation
PFI_LSAN | kg/m2/s| xyz | E | | 3D_flux_of_ice_nonconvective_precipitation
U | m s-1 | xyz | C | | eastward_wind
V | m s-1 | xyz | C | | northward_wind

category: EXPORT
#----------------------------------------------------------------------------------------
# VARIABLE | DIMENSIONS | Additional Metadata
#----------------------------------------------------------------------------------------
NAME | UNITS | DIMS| VLOC| UNGRIDDED | LONG_NAME
#----------------------------------------------------------------------------------------
AIRDENS | kg/m^3 | xyz | C | | moist_air_density
DUMASS | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__
DUMASS25 | kg kg-1 | xyz | C | | Dust Mass Mixing Ratio __ENSEMBLE__
DUCONC | kg m-3 | xyz | C | | Dust Mass Concentration __ENSEMBLE__
DUEXTCOEF | m-1 | xyz | C | | Dust Extinction Coefficient [550 nm] __ENSEMBLE__
DUSCACOEF | m-1 | xyz | C | | Dust Scattering Coefficient [550 nm] __ENSEMBLE__
#........................................................................................
DUSMASS | kg m-3 | xy | N | | Dust Surface Mass Concentration __ENSEMBLE__
DUCMASS | kg m-2 | xy | N | | Dust Column Mass Density __ENSEMBLE__
DUEXTTAU | 1 | xy | N | | Dust Extinction AOT [550 nm] __ENSEMBLE__
DUSCATAU | 1 | xy | N | | Dust Scattering AOT [550 nm] __ENSEMBLE__
DUSMASS25 | kg m-3 | xy | N | | Dust Surface Mass Concentration - PM 2.5 __ENSEMBLE__
DUCMASS25 | kg m-2 | xy | N | | Dust Column Mass Density - PM 2.5 __ENSEMBLE__
DUEXTT25 | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 2.5 __ENSEMBLE__
DUSCAT25 | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 2.5 __ENSEMBLE__
DUAERIDX | 1 | xy | N | | Dust TOMS UV Aerosol Index __ENSEMBLE__
DUFLUXU | kg m-1 s-1 | xy | N | | Dust column u-wind mass flux __ENSEMBLE__
DUFLUXV | kg m-1 s-1 | xy | N | | Dust column v-wind mass flux __ENSEMBLE__
DUEXTTFM | 1 | xy | N | | Dust Extinction AOT [550 nm] - PM 1.0 um __ENSEMBLE__
DUSCATFM | 1 | xy | N | | Dust Scattering AOT [550 nm] - PM 1.0 um __ENSEMBLE__
DUANGSTR | 1 | xy | N | | Dust Angstrom parameter [470-870 nm] __ENSEMBLE__
DUEM | kg m-2 s-1 | xy | N | self%nbins | Dust Emission All Bins __ENSEMBLE__
DUSD | kg m-2 s-1 | xy | N | self%nbins | Dust Sedimentation All Bins __ENSEMBLE__
DUDP | kg m-2 s-1 | xy | N | self%nbins | Dust Dry Deposition All Bins __ENSEMBLE__
DUWT | kg m-2 s-1 | xy | N | self%nbins | Dust Wet Deposition All Bins __ENSEMBLE__
DUSV | kg m-2 s-1 | xy | N | self%nbins | Dust Convective Scavenging All Bins __ENSEMBLE__


category: INTERNAL
#----------------------------------------------------------------------------------------
# VARIABLE | DIMENSION | Additional Metadata
#----------------------------------------------------------------------------------------
NAME | UNITS | DIMS | VLOC | UNGRIDDED | RESTART | ADD2EXPORT | FRIENDLYTO | LONG NAME
#----------------------------------------------------------------------------------------
DU |kg kg-1| xyz | C | self%nbins | MAPL_RestartOptional | .true. | DYNAMICS:TURBULENCE:MOIST | Dust Mixing Ratio all bins



#********************************************************
#
# Legend
#
#------------------------------------------------------------------
# Column label | MAPL keyword/interpretation | Default
#--------------|---------------------------------------------------
# NAME | short_name |
# UNITS | units |
# DIMS | dims |
# VLOC | VLocation | MAPL_VLocationNone
# LONG NAME | long_name |
# COND | if (<logical-expr>) then | .FALSE.
# NUM_SUBTILES | num_subtiles
# ...
#------------------------------------------------------------------
#
#--------------------------------------------
# Entry alias | Column | MAPL keyword/interpretation
#--------------|-----------------------------
# xyz | DIMS | MAPL_HorzVert
# xy | DIMS | MAPL_HorzOnly
# z | DIMS | MAPL_VertOnly (plus ungridded)
# C | VLOC | MAPL_VlocationCenter
# E | VLOC | MAPL_VlocationEdge
# N | VLOC | MAPL_VlocationNone
#--------------------------------------------


23 changes: 23 additions & 0 deletions ESMF/Aerosol_GridComp/AeroCinderella_GridComp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
esma_set_this()

set (alldirs
Cinderella
)

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/AeroCinderella_GridComp.F90)

esma_add_library (${this}
SRCS AeroCinderella_GridComp.F90
SUBCOMPONENTS ${alldirs}
DEPENDENCIES MAPL GEOS_Shared
INCLUDES ${INC_ESMF})

mapl_acg (${this} AeroCinderella_StateSpecs.rc
IMPORT_SPECS EXPORT_SPECS INTERNAL_SPECS
GET_POINTERS DECLARE_POINTERS)

else ()

esma_add_subdirectories (${alldirs})

endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
esma_set_this()

set (srcs
LinearFields.F90
ConvertUnits_private.F90
ConvertUnits.F90
NOAA_TracerMap.F90
NOAA_GOCARTtracers.F90
MissingFields.F90
)

esma_add_library(${this}
SRCS ${srcs}
DEPENDENCIES MAPL GEOS_Shared)

target_include_directories (${this} PUBLIC ${INC_ESMF} ${INC_NETCDF})

if (PFUNIT_FOUND)
add_subdirectory(tests EXCLUDE_FROM_ALL)
endif ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module ConvertUnits_mod
use ConvertUnits_private_mod, only: read_scale_config, ScaleMapReal32, ScaleMapReal64

implicit none
private

public read_scale_config
public ScaleMapReal32
public ScaleMapReal64
end module ConvertUnits_mod
Loading

0 comments on commit 86a7354

Please sign in to comment.