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

instructions for GSFC #1

Open
BenjaminTJohnson opened this issue May 16, 2024 · 1 comment
Open

instructions for GSFC #1

BenjaminTJohnson opened this issue May 16, 2024 · 1 comment

Comments

@BenjaminTJohnson
Copy link
Collaborator

BenjaminTJohnson commented May 16, 2024

A brief/temporary issue to cover updated instructions for a test branch of the CRTM coefficient generation package.

This replaces certain commands in the quickstart guide:
https://github.com/JCSDA/CRTM_coef/blob/develop/doc/QuickStartGuide/QuickStartGuide.pdf

Clone:

git clone https://github.com/JCSDA/CRTM_coef
cd CRTM_coef
git checkout feature/btj_cmake_install_plus 

Preparing for build

mkdir build
cd build
cmake ..

Note: If you're unable to find netCDF at this step, then we need to give the environment variable that provides hints to the finder:

locate libnetcdff.so    #2 f's here, for the fortran library
export netCDF_ROOT=<path above that's consistent with your compiler version, excluding /lib or /include directory> 
cmake ..

Example:

> ifort --version
ifort (IFORT) 2021.5.0 20211109

> locate libnetcdff.so
<...>
/opt/netcdf4/4.8.1-intel-2022.1/lib/libnetcdff.so.7
<...>

> export netCDF_ROOT=opt/netcdf4/4.8.1-intel-2022.1/
> cmake ..

Next compile and install the code:

make -j8
make install 

It should, at this point download and compile CRTM and compile the local utilities that we need.

Here's the list of utility names, some of these may have changed w.r.t. to the tutorial.
These are located in build\bin after successful compilation and installation.

Assemble_ODAS
Assemble_ODPS
AtmProfile_CreateFile
Create_SpcCoeff
GetSenInfo
MW_TauProfile
ODAS_NC2BIN
ODAS_Regress
ODAS_WLO_Regress
ODPS_NC2BIN
ODPS_Regress
oSRF_Create_from_ASCII
SpcCoeff_NC2BIN

Next let's make a new branch off of this one, just to avoid any issues:
git checkout -b feature/yourinitials_branchname
e.g., git checkout -b feature/btj_tropics_test

Now back to the tutorial steps, starting at step 2.3: "Preparing the SRF"

Anywhere you see "var.out" this is replaced with oSRF_Create_from_ASCII

Also, before running step 2.5:

export PATH="$PATH:~/CRTM_Coef/build/bin/"

this is to get the executables accessible from anywhere. Also, ignore "./" in front of command names, the PATH takes care of that.

For step 2.5, you'll see:

> oSRF_Create_from_ASCII
 Enter the Sensor ID of the current instrument:
tropics_sv1_srf_v2
 Enter the number of bands for the instrument:
1
 Enter the number of instrument channels:
12
 Enter the channel start number:
1
 Enter the channel end number:
12
 Please enter one of the available instrument types:
 Select the sensor type:
                     1 Microwave
                     2 Infrared
                     3 Visible
                     4 Ultraviolet
1
 Is SRF interpolation requested (yes/no)?
yes
 Enter the spectral resolution in [GHz] :
0.001

Step 2.6:

 cd workdir/MW/tropics_sv1_srf_v2    #(or whatever you've named your workdir)
 cp -r ~/CRTM_coef/inbox/fix/config/TROPICS-constellation/TROPICS_Pathfinder/tropics_sv1_srf_v2/* .

This ensures all of the configuration information is available to step 2.6. Modify the above paths as necessary.

Follow steps 2.6, 2.7
You may run into this error:

 Check_Binary_File(FAILURE) : Unrecognised file format. Invalid magic number.
 Open_Binary_File(FAILURE) : Error checking tropics_sv1_srf_v2.SpcCoeff.bin file byte order
 SpcCoeff_ReadFile(Binary)(FAILURE) : Error opening tropics_sv1_srf_v2.SpcCoeff.bin
 SpcCoeff_netCDF_to_Binary(FAILURE) : Error reading Binary file tropics_sv1_srf_v2.SpcCoeff.bin for test
 SpcCoeff_NC2BIN(FAILURE) : SpcCoeff netCDF -> Binary conversion failed!

This is saying that there's a conflict between endianness. However, we don't really need the binary files, we can just use netCDF (preferred).

Step 2.8:

@BenjaminTJohnson
Copy link
Collaborator Author

Updated Instructions:

module use /discover/swdev/gmao_SIteam/modulefiles-SLES12
module use /discover/swdev/jcsda/spack-stack/scu16/modulefiles
module load miniconda/3.9.7
module load ecflow/5.8.4

module use /gpfsm/dswdev/jcsda/spack-stack/scu16/spack-stack-1.7.0/envs/ue-intel-2021.6.0/install/modulefiles/Core
module load stack-intel/2021.6.0
module load stack-intel-oneapi-mpi/2021.6.0
module load stack-python/3.10.13

module load netcdf-fortran/4.6.1
module load cmake/3.23.1
module load openblas/0.3.24
module load git-lfs/3.0.2

git clone -b feature/btj_cmake_install_plus https://github.com/JCSDA/CRTM_coef
cd CRTM_coef
mkdir build
cd build
cmake .. 2>&1 | tee log.cmake

# This can fail because the network is so darn slow. If that happens, files may
# have been cloned only partially. I had to do this to repair the clone:
cd ..
git status
git reset HEAD .
git checkout .
git status
# at this point there should be no more diffs (deleted files etc)

cd build
cmake .. 2>&1 | tee log.cmake
make VERBOSE=1 -j4 2>&1 | tee log.make

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

No branches or pull requests

1 participant