Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1e87690
add make_topo scripts to generate BCs topography files
weiyuan-jiang Feb 7, 2025
69ba35f
add account
weiyuan-jiang Feb 10, 2025
4879e21
no extra 0 for the string of grid size
weiyuan-jiang Feb 12, 2025
8f24898
add rrfac and rrfac_max
weiyuan-jiang Feb 13, 2025
f211d56
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Feb 21, 2025
76b9a6e
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Feb 24, 2025
1c37eaa
remove rrfac whne it is not stretched
weiyuan-jiang Feb 26, 2025
be0f7dc
Merge branch 'feature/wjiang/add_topo' of github.com:GEOS-ESM/GEOSgcm…
weiyuan-jiang Feb 26, 2025
1c22326
add c5760
weiyuan-jiang Feb 27, 2025
1e3ebb2
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin May 14, 2025
945649e
edits needed to make stretched grid work
biljanaorescanin May 20, 2025
46f6485
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin May 20, 2025
b68774d
disable for now c5760
biljanaorescanin May 20, 2025
df3535a
cleanup and fixes, adds for more flexibility
biljanaorescanin May 31, 2025
6a00126
safeguards for small area neded for c5760.
biljanaorescanin Jun 5, 2025
9c3f4b3
Clarify question, add gitignore
mathomp4 Jun 5, 2025
d5f0472
right res is c1536
biljanaorescanin Jun 11, 2025
1191229
global stretch attributes for gwd_internal_rst
biljanaorescanin Jun 12, 2025
83de668
fix last commit
biljanaorescanin Jun 12, 2025
5b18d20
fix for command line
biljanaorescanin Jun 12, 2025
a5b0046
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Jun 12, 2025
76b87b5
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Jul 1, 2025
81d29a5
fix stretched grid, protections for regular fine
biljanaorescanin Aug 20, 2025
a244961
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Aug 20, 2025
f7914c8
missing commit
biljanaorescanin Aug 21, 2025
f7081f3
trb improved accuracy for c12,c24,c48
biljanaorescanin Aug 25, 2025
0bd8d55
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Aug 28, 2025
1c15a7c
fix units for gwd_internal_rst
biljanaorescanin Aug 28, 2025
4b4b31a
fix units for gwd_internal_rst only
biljanaorescanin Aug 29, 2025
de98537
redo previous commit with diff approach
biljanaorescanin Aug 29, 2025
a5871db
Fix up Spack CI
mathomp4 Sep 10, 2025
ea13d44
Merge branch 'develop' into feature/wjiang/add_topo
biljanaorescanin Sep 17, 2025
a5bab4c
Update GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Ut…
mathomp4 Sep 18, 2025
2b909d8
Update GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Ut…
mathomp4 Sep 18, 2025
555e786
Merge pull request #1054 from GEOS-ESM/feature/wjiang/add_topo
mathomp4 Sep 18, 2025
1e77607
Merge branch 'main' into develop
mathomp4 Sep 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/spack-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ jobs:
shell: spack-bash {0}
run: |
spack -e spack-env mirror add geos-buildcache oci://ghcr.io/GEOS-ESM/geos-buildcache
spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" geos-buildcache
spack -e spack-env mirror set --oci-username-variable "${{ secrets.BUILDCACHE_USERNAME }}" --oci-password-variable "${{ secrets.BUILDCACHE_TOKEN }}" geos-buildcache
spack -e spack-env mirror list
spack -e spack-env buildcache update-index geos-buildcache
spack -e spack-env buildcache list --allarch

- name: Concretize
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/@ncar_topo/
/ncar_topo/
/ncar_topo@/
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ else ()
target_compile_definitions(${this} PRIVATE STDC)
endif ()

esma_add_subdirectories (@ncar_topo utils_topo)

ecbuild_add_executable (TARGET CombineRasters.x SOURCES CombineRasters.F90 LIBS MAPL ${this})
ecbuild_add_executable (TARGET mkCatchParam.x SOURCES mkCatchParam.F90 LIBS MAPL ${this} OpenMP::OpenMP_Fortran)
ecbuild_add_executable (TARGET mkCubeFVRaster.x SOURCES mkCubeFVRaster.F90 LIBS MAPL ${this})
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#--------------------
# Copy include files that are used by other libraries.
# We could leave these in the source directory, and just broaden the search path
# in the other libaries, but this make it explicit which aspects are externally
# used.

ecbuild_add_executable (TARGET generate_scrip_cube_topo.x SOURCES generate_scrip_cube.F90 geompack.F90)
target_link_libraries (generate_scrip_cube_topo.x PRIVATE MPI::MPI_Fortran esmf)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(generate_scrip_cube_topo.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

ecbuild_add_executable (TARGET convert_bin_to_netcdf_topo.x SOURCES convert_bin_to_netcdf.F90)
target_link_libraries (convert_bin_to_netcdf_topo.x PRIVATE MPI::MPI_Fortran NetCDF::NetCDF_Fortran)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(convert_bin_to_netcdf_topo.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

ecbuild_add_executable (TARGET convert_to_gmao_output_topo.x SOURCES convert_to_gmao_output.F90)
target_link_libraries (convert_to_gmao_output_topo.x PRIVATE MPI::MPI_Fortran NetCDF::NetCDF_Fortran)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(convert_to_gmao_output_topo.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

install(PROGRAMS scrip_to_cube_topo.py DESTINATION bin)
install(PROGRAMS scrip_to_restart_topo.py DESTINATION bin)
install(PROGRAMS generate_topo.sh DESTINATION bin)
install(PROGRAMS make_topo.py DESTINATION bin)
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
program create_example
use netcdf
use, intrinsic :: iso_fortran_env, only: REAL64
implicit none


character(len=512) :: fin,fout,str,fncar
integer :: im_world,jm_world
integer :: varid, lonid, latid
integer :: i, j, nc,xid,yid
integer :: zid,gwdid,trbid
integer :: ncid,rc
integer :: dimids(2)
integer :: status

integer :: nargs

logical :: doNcar,doGEOS

integer :: ntiles
real, allocatable :: z1d(:)
real(REAL64), allocatable :: xdim(:),ydim(:)
real, allocatable :: a(:,:)
logical :: isCube

nargs = command_argument_count()

doNCAR=.false.
doGEOS=.false.
isCube = .true.
do i=1,nargs
call get_command_argument(i,str)
select case(trim(str))
case ('-i','--input')
call get_command_argument(i+1,fin)
case ('-o','--output')
call get_command_argument(i+1,fout)
doGEOS=.true.
case ('--im')
call get_command_argument(i+1,str)
read(str,'(I10)')im_world
case ('--jm')
call get_command_argument(i+1,str)
read(str,'(I10)')jm_world
isCube = .false.
case ('--ncar')
call get_command_argument(i+1,fncar)
doNCAR=.true.
end select
enddo

if (isCube) jm_world = im_world*6

allocate(a(im_world,jm_world))
open(file=fin,unit=21,form='unformatted')
read(21)a
close(21)

if (doGEOS) then

call check( nf90_create(fout, NF90_NETCDF4,ncid),"error")
call check( nf90_def_dim(ncid,"Xdim",im_world,lonid),"error")
call check( nf90_def_var(ncid,"Xdim",NF90_DOUBLE,(/lonid/),xid),"error")
call check( nf90_put_att(ncid,xid,"units","degrees_east"),"error")
call check( nf90_def_dim(ncid,"Ydim",jm_world,latid),"error")
call check( nf90_def_var(ncid,"Ydim",NF90_DOUBLE,(/latid/),yid),"error")
call check( nf90_put_att(ncid,yid,"units","degrees_north"),"error")
call check( nf90_def_var(ncid,"z",NF90_FLOAT,(/lonid,latid/),varid),"error")
call check( nf90_put_att(ncid,varid,"units","m"),"error")
call check( nf90_put_att(ncid,varid,"long_name","height above sea level"),"error")

call check( nf90_enddef(ncid),"error")

allocate(xdim(im_world),ydim(jm_world))
do i=1,im_world
xdim(i)=i
enddo
do j=1,jm_world
ydim(j)=j
enddo

call check(nf90_put_var(ncid,xid,xdim),"error")
call check(nf90_put_var(ncid,yid,ydim),"error")
call check(nf90_put_var(ncid,varid,a),"error")
call check(nf90_close(ncid),"error")

end if

if (doNCAR) then

ntiles=im_world*jm_world
allocate(z1d(ntiles))
call check( nf90_create(fncar, NF90_NETCDF4,ncid),"error")
call check( nf90_def_dim(ncid,"ncol",ntiles,xid),"error")
call check( nf90_def_var(ncid,"PHIS",NF90_DOUBLE,(/xid/),varid),"error")
call check( nf90_put_att(ncid,varid,"long_name","height"),"error")
call check( nf90_put_att(ncid,varid,"units","m"),"error")
call check( nf90_enddef(ncid),"error")

nc=0
do j=1,jm_world
do i=1,im_world
nc=nc+1
z1d(nc)=a(i,j)
enddo
enddo

call check(nf90_put_var(ncid,varid,z1d),"error")

end if

contains

subroutine check(status,loc)

integer, intent ( in) :: status
character(len=*), intent ( in) :: loc

if(status /= NF90_noerr) then
write (*,*) "Error at ", loc
write (*,*) nf90_strerror(status)
stop "Stopped"
end if

end subroutine check

end program create_example

Loading