NCAR / DART

Data Assimilation Research Testbed
https://dart.ucar.edu/
Apache License 2.0
197 stars 145 forks source link

Atmospheric Chemistry observation converters and forward operators #743

Open hkershaw-brown opened 1 month ago

hkershaw-brown commented 1 month ago

Atmospheric Chemistry observation converters and forward operators in DART.

https://github.com/NCAR/DART/tree/atmos-chem

Notable changes (see commits on branch for files changed):

chore: preprocess input.nmls to have only required obs_defs

the 63341  lines of obs_def_mod if you have every atmos-chem is
a waste of time compiling, and indicates false dependencies between
the converters.

fix: iso_c_binding to use getpid

Note this init_random_seed routine is copied from gcc documentation
Not sure why the DART random utilities not used

directory 'suspect code'

    This code appears to have NCEPLIBS library code in it.
    Some linear algebra that should probably be replaced by library calls. 
    Some time utilities that are probably available already elsewhere in DART.  

    Does not compile: (fixed with iso_c_binding) ! note HK fixed
    Error: IF clause at (1) requires a scalar LOGICAL expression
    also non standard:
    Warning: Legacy Extension: Comma before i/o item list at (1)

There is also lots of 'double precision' rather than kinds so be aware of this if you are compiling and playing with precision.

Note there are a few utility routines added to utilities_mod.f90 for 'writing an integer', 'writing a real'. I've left this in for compiling, but probably going to pull these out.

On Derecho you’ll need mkl loaded (module load mkl) for the linear algebra calls that do use a library. Flags for ifort:

LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl

It looks like a lot of this code is super repetitive. There are unused routines in the converters, I have not made an effort to remove these yet. There looks to be some WRF specific routines in the obs_def_mods, but this may just be copy and past routines that are not used.