﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
794	VERY IMPORTANT: Build scripts and standard input	arango		"I wanted to rework the ROMS build scripts for a while to separate the user's customized library paths to a single file that can be included if so desired. Also, I needed some explicit renaming and cleaning because of the underway ESMF/NUOPC coupling.

== '''RENAMING'''

To avoid ambiguity with other Earth System Model (ESM) components during coupling the following files were renamed:

* The ROMS build scripts are renamed to '''build_roms.bash''' and '''build_roms.sh''' for the BASH and CSH shell environments, respectively.

* The ROMS executable is renamed to '''romsS''' (serial), '''romsM''' (distributed-memory, MPI), '''romsO''' (shared-memory, OpenMP), and '''romsG''' (debugging). The '''ocean''' executable names were to generic and ambiguous if one wants to couple two different ocean models.

* All the distributed ROMS standard input files are renamed to '''roms_APP.in''' where '''APP''' is the application or test case. For example, we have now '''roms_upwelling.in'''.

* All the default filenames are renamed to '''roms_TYP.nc''' where '''TYP''' is the type of NetCDF file. Again, the '''ocean''' prefix was too generic and ambiguous.  For example, we now have '''roms_avg.nc''', '''roms_his.nc''', '''roms_rst.nc''', and so on. Notice that the user still has the choice to change the filename of ROMS input and output NetCDF files.

There are a lot of simple changes in this update with '''svn mv''' commands.  The '''test''' cases repository was also completely updated.
== CLEANING

* The '''!SeaIce''' subdirectory is moved to be inside of the '''Nonlinear''' sub-directory as it should be. It will facilitate in the future the writing of the tangent linear and adjoint transformations of such model in the '''Tangent''', '''Representer''', and '''Adjoint''' sub-directories. The movement of the '''!SeaIce''' sub-directory will not affect the compiling and linking since ROMS '''makefile''' system is very flexible and powerful.  The '''makefile''' was changed accordingly.

* The '''Atmosphere''' sub-directory is removed from the repository. The new strategy for ESMF/NUOPC coupling is for the user to subscribe to such repositories and download and install the ESM component.  ESM components are compiled and linked separated from ROMS.  We need to use the libraries and sometimes few modules and object files to compile ROMS successfully in coupled applications.  ROMS is driving the coupling.

* All the user-customized library paths are now included, if so desired,  in a script:
 * '''Compilers/my_build_paths.sh''' (CSH script) or
 * '''Compilers/my_build_paths.bash''' (BASH script)
 
 Notice that we can specify an alternate directory in the build script. I keep my customized copies in '''${HOME}/Compilers/ROMS'''. In '''build_roms.bash''' we have:
 {{{
# Set path of the directory containing makefile configuration (*.mk) files.
# The user has the option to specify a customized version of these files
# in a different directory than the one distributed with the source code,
# ${MY_ROMS_SRC}/Compilers. If this is the case, you need to keep
# these configurations files up-to-date.

 export         COMPILERS=${MY_ROMS_SRC}/Compilers
#export         COMPILERS=${HOME}/Compilers/ROMS

...

#--------------------------------------------------------------------------
# If applicable, use my specified library paths.
#--------------------------------------------------------------------------

 export USE_MY_LIBS=no            # use system default library paths
#export USE_MY_LIBS=yes           # use my customized library paths

if [ ""${USE_MY_LIBS}"" = ""yes"" ]; then
  source ${COMPILERS}/my_build_paths.bash
fi
}}}

== WHAT IS NEW

A new sub-directory '''ESM''' is added at the root containing scripts and modified ESM component files that substitute the ones distributed from source repositories to solve various technical issues during coupling (see '''ESM/Readme''' for details). The WRF files below were adapted from '''Version 4.0.3''' (December 18, 2018).

* '''coupling_esmf.in:''' Standard input script for ROMS when coupling with the ESMF/NUOPC library. It is well documented and sets the coupling system. To submit a job, we could use for example:
 {{{
  mpirun -np 8 romsM coupling_esmf.in > & log &
}}}

* '''coupling_esmf.dat:''' Coupling metadata defining import and export fields.

* '''build_cice.sh:''' A friendlier CSH script to compile CICE.

* '''build_wrf.bash''', '''build_wrf.sh''': BATCH and CSH compiling scripts for WRF to facilitate easy compiling and linking.  It also corrects several technical issues with very old ESMF library interference and incorrect NetCDF4 library dependencies.

* '''wrf_configure:''' Reworking of linking NetCDF4 library dependencies. It replaces '''${WRF_ROOT_DIR}/configure'''.

* '''wrf_add_configue:''' Adds CPP macros to rename '''ESMF''' and '''esmf''' to '''MYESMF''' and '''myesmf''' to the dependencies of '''module_domain.o''' and '''output_wrf.o''' to avoid conflicts with newer versions of the ESMF/NUOPC library. It appends to '''${WRF_ROOT_DIR}/configure.wrf'''.

* '''wrf_Makefile:''' Reworking of linking NetCDF4 library dependencies. Ir replaces '''${WRF_ROOT_DIR}/Makefile'''.

* '''wrf_postamble:''' Reworking of linking NetCDF4 library dependencies. It replaces '''${WRF_ROOT_DIR}/arch/postamble'''.

* '''wrf_configure.defaults:''' Substitutes obsolete compiling option '''-openmp''' to '''-qopenmp'''. It renames ocurrences of '''ESMF''' and '''esmf''' to '''MYESMF''' and '''myesmf''' to avoid conflicts with newer versions of the ESMF.  WRF uses parts of an old version of the ESMF library for its internal time clock.  It causes conflicts when coupling with newer ESMF/NUOPC library.  Added mixed compiling with Intel/GNU (ifort/gcc) and OpenMPI. It replaces '''${WRF_ROOT_DIR}/arch/configure.defaults'''.

* '''wrf_Config.pl:''' It renames ocurrences of '''ESMF''' and '''esmf''' to '''MYESMF''' and '''myesmf''' to avoid conflicts with newer versions of the ESMF. It replaces '''${WRF_ROOT_DIR}/arch/Config.pl'''

* '''wrf_Makefile.esmf:''' It renames ocurrences of '''ESMF''' and '''esmf''' to '''MYESMF''' and '''myesmf''' to avoid conflicts with newer versions of the ESMF. Everything is done during C-preprocessing, so original files are not modified. It replaces '''${WRF_ROOT_DIR}/external/esmf_time_f90/Makefile'''.

* '''wrf_Test1.F90:''' It corrects bug in optional argument to '''ESMF_Initialize''' call from '''!defaultCalendar''' to '''1defaultCalKind'''. It replaces '''${WRF_ROOT_DIR}/external/esmf_time_f90/Test1.F90'''.

I will contact WRF developers to take care of these problems in future versions. However, we still this corrections or similar in an older or current version of WRF.  I provide the full file so the user can compare the files to check the nature of the changes.

== WARNING

The coupling via the ESMF/NUOPC is still now available for usage."	upgrade	closed	major	Release ROMS/TOMS 3.7	Nonlinear	3.7	Done		
