Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MOM6SOLO build in the EMC branch. #41

Closed
aerorahul opened this issue Nov 20, 2020 · 4 comments · Fixed by #43
Closed

Fix MOM6SOLO build in the EMC branch. #41

aerorahul opened this issue Nov 20, 2020 · 4 comments · Fixed by #43
Assignees

Comments

@aerorahul
Copy link

There is an issue with compiling the standalone MOM6 within UFS (or even without UFS) in the dev/emc branch

There was a bug in the way the wave forcing subroutine was being called with incorrect number of arguments.

To reproduce the compilation error from the UFS-weather-model repo

CMAKE_FLAGS="-DMOM6SOLO=ON -DS2S=ON -DDATM=ON" BUILD_VERBOSE=1 BUILD_JOBS=1 BUILD_DIR=build-datmmom6 ./build.sh
[ 99%] Building Fortran object MOM6-interface/CMakeFiles/mom6solo.dir/MOM6/config_src/solo_driver/MOM_driver.F90.o
cd /Users/rmahajan/scratch/UFSwork/weather-develop/build-datmmom6/MOM6-interface && /opt/modules/gnu-9.3.0/mpich/3.3.1/bin/mpifort -DENABLE_QUAD_PRECISION -DGFS_PHYS -DINTERNAL_FILE_NML -Duse_libMPI -Duse_netCDF -I/Users/rmahajan/scratch/UFSwork/weather-develop/build-datmmom6/MOM6-interface/mod -I/Users/rmahajan/scratch/UFSwork/weather-develop/build-datmmom6/MOM6-interface/mod_solo -I/Users/rmahajan/scratch/UFSwork/weather-develop/MOM6-interface/MOM6/config_src/dynamic -I/Users/rmahajan/scratch/UFSwork/weather-develop/MOM6-interface/MOM6/src/framework -I/Users/rmahajan/scratch/UFSwork/weather-develop/FMS/include -I/Users/rmahajan/scratch/UFSwork/weather-develop/FMS/fms -I/Users/rmahajan/scratch/UFSwork/weather-develop/FMS/mpp/include -I/Users/rmahajan/scratch/UFSwork/weather-develop/build-datmmom6/FMS/mod -I/opt/modules/gnu-9.3.0/mpich-3.3.1/netcdf/4.7.4/include -g -fbacktrace -fdefault-real-8 -fdefault-double-8 -Waliasing -fcray-pointer -fconvert=big-endian -ffree-line-length-none -fno-range-check -fbacktrace -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.15 -Jmod_solo -c /Users/rmahajan/scratch/UFSwork/weather-develop/MOM6-interface/MOM6/config_src/solo_driver/MOM_driver.F90 -o CMakeFiles/mom6solo.dir/MOM6/config_src/solo_driver/MOM_driver.F90.o
/Users/rmahajan/scratch/UFSwork/weather-develop/MOM6-interface/MOM6/config_src/solo_driver/MOM_driver.F90:491:79:

  491 |       call Update_Surface_Waves(grid, GV, US, time, time_step_ocean, waves_csp)
      |                                                                               1
Error: Missing actual argument for argument 'forces' at (1)
make[2]: *** [MOM6-interface/CMakeFiles/mom6solo.dir/MOM6/config_src/solo_driver/MOM_driver.F90.o] Error 1
make[1]: *** [MOM6-interface/CMakeFiles/mom6solo.dir/all] Error 2
make: *** [all] Error 2
@aerorahul
Copy link
Author

Please assign to the appropriate person.

@aerorahul
Copy link
Author

This is all that is required to enable building of mom6solo at this time.

~/s/U/w/M/MOM6 ❯❯❯ git diff                                       feature/update-to-GFDL-20201022 ✱
diff --git i/src/user/MOM_wave_interface.F90 w/src/user/MOM_wave_interface.F90
index e9b0669f4..b2ca9c875 100644
--- i/src/user/MOM_wave_interface.F90
+++ w/src/user/MOM_wave_interface.F90
@@ -452,7 +452,7 @@ subroutine Update_Surface_Waves(G, GV, US, Day, dt, CS, forces)
   type(unit_scale_type),   intent(in)  :: US   !< A dimensional unit scaling type
   type(time_type),         intent(in)  :: Day !< Current model time
   type(time_type),         intent(in)  :: dt  !< Timestep as a time-type
-  type(mech_forcing),      intent(in)  :: forces !< MOM_forcing_type
+  type(mech_forcing),      intent(in), optional  :: forces !< MOM_forcing_type
   ! Local variables
   integer :: ii, jj, kk, b
   type(time_type) :: Day_Center

But the issue should be resolved more carefully and systematically by working with someone from GFDL. dev/emc should not maintain its own version of the following files that reside in src, else we would be cherry-picking every single time there is a rebase/merge from main

src/core/MOM_forcing_type.F90
src/user/MOM_wave_interface.F90

@jiandewang
Copy link
Collaborator

besides what you pointed, there are also some codes need to be cleaned in GFDL's driver code. I fully agree with you that we need to solve this in a careful way as we don't want to break GFDL side system. At the time when Brandon and Jessica merged in the wave section of code in EMC repo, they didn't test in the stand along mode (and they couldn't as the stand alone feature was not in the system yet at that time).

@aerorahul
Copy link
Author

Ok. Good. Please start with identifying those codes that need to be cleaned, create issues and assign them.
The longer this stays diverged, the more difficult it will be to reconcile later.
There are other groups developing ocean wave interaction with MOM6.

jiandewang pushed a commit to jiandewang/MOM6 that referenced this issue Jun 17, 2021
jiandewang pushed a commit to jiandewang/MOM6 that referenced this issue Feb 1, 2022
* Hydrostatic initialization in ice cavities

    - Iteratively solve for the initial ice shelf displacement
      in cavities by calculating the pressure at the current
      displacement depth using the unperturbed profile.
    - This change should obsolete TRIM_IC_FOR_PSURF and DEPRESS_INITIAL_SURFACE for
      ice shelf applications and should work for arbitrary equations of state.
    - Existing implementations (e.g. ISOMIP) should turn off the above options
      in order to exercise this feature.
    - This code change should not impact non ice-shelf configurations
      or those with either of the above two options.

* Addresses a number of issues identified in code review.

* add appropriate intent to ice_shelf_query

* fix unit scaling comments

Co-authored-by: Marshall Ward <marshall.ward@noaa.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants