Diferencia entre revisiones de «CDXWRFinstall»

De Wikicima
Sin resumen de edición
 
(No se muestran 4 ediciones intermedias del mismo usuario)
Línea 2: Línea 2:


These steps must be followed prior the re-compilation of the WRF model and assuming that the process is started where the code resides (WRFV3). '''NOTE:''' make sure that the already compiled version of WRF and the version of the module are the same!
These steps must be followed prior the re-compilation of the WRF model and assuming that the process is started where the code resides (WRFV3). '''NOTE:''' make sure that the already compiled version of WRF and the version of the module are the same!
== From repository ==
# Get the code, there are different options
=== From Lluís Fita's WRF fork (recomended) ===
This is the unique source of the module with the latest version (currently v3.1) of the module. It is going to be proposed to be incorporated into the official WRF GIT repository.
# Get the code
<PRE style="shell">
git clone git@github.com:LluisFB/WRF.git
git submodule update --init --recursive
git checkout cdxwrf
</PRE>
# Clean the code (in order to avoid to run again configure one can make a copy of the `<CODE>configure.wrf</CODE>` and recover it after the clean, otherwise it is erased)
<PRE style="shell">
cp configure.wrf configure.cordex.wrf
./clean -a
cp configure.cordex.wrf configure.wrf
</PRE>
# edit the <CODE>configure.wrf</CODE> and add the line (after the line <CODE>-DNETCDF</CODE>)
<PRE style="shell">
                      -DCORDEXDIAG \
</PRE>
# Set up (or not) the pre-compilation variable <CODE>CDXWRF</CODE> (after the line <CODE>-DCORDEXDIAG</CODE>)
<PRE style="shell">
                      -DCDXWRF=[value] \
</PRE>
Accordingly to the value given to the pre-compilation variable CDXWRF one obtains:
* Without adding the variable: all CORDEX <CODE>Core</CODE> variables
* <CODE>CDXWRF=1</CODE> CORDEX 'Tier' variables: clivg, clivh, zmla, [cape/cin/zlfc/plfc/lidx]{min/max/mean} (if in namelist.input convxtrm_diag = 1), colmax, prhf
* <CODE>CDXWRF=2</CODE> The same as with <CODE>CDXWRF=1</CODE> and additional variables: ua, va, ws, ta, press, zg, hur, hus, tfog, fogvisbltymin, fogvisbltymax, fogvisbltymean, tds[min/max/mean], tws[min/max/mean]
* <CODE>CDXWRF=3</CODE> The same as with <CODE>CDXWRF=1,2</CODE> and additional residence-time variables
* <CODE>CDXWRF=4</CODE> The same as with <CODE>CDXWRF=1,2</CODE> and <CODE>3</CODE> and the Water-Budget relarted ones: wbacdiabh, wbacpw, wbacpw[c/r/s/i/g/h], wbacf, wbacf[c/r/s/i/g/h], wbacz, wbacz[c/r/s/i/g/h], wbacdiabh{l/m/h}, wbacpw{l/m/h}, wbacpw[c/r/s/i/g/h]{l/m/h}, wbacf{l/m/h}, wbacf[c/r/s/i/g/h]{l/m/h}, wbacz{l/m/h}, wbacz[c/r/s/i/g/h]{l/m/h}
Simultaneosuly, one needs to:
* make a copy of <CODE>Registry/registry.cordex</CODE>
<PRE style="shell">
cp Registry/registry.cordex Registry/registry.cordex_comp
</PRE>
* modify the <CODE>Registry/registry.cordex_comp</CODE> accordingly to the value of <CODE>CDXWRF</CODE>:
** Without adding <CODE>CDXWRF</CODE>, nothing needs to be changed
** Adding <CODE>CDXWRF=1</CODE>, one needs to remove the comment <CODE>##CDXWRF1##</CODE> at the beginning of the line of the definition of certain variables
** Adding <CODE>CDXWRF=2</CODE>, one needs to remove the comment <CODE>##CDXWRF1##</CODE> and <CODE>##CDXWRF2##</CODE> at the beginning of the line of the definition of certain variables
** Adding <CODE>CDXWRF=3</CODE>, one needs to remove the comment <CODE>##CDXWRF1##</CODE>, <CODE>##CDXWRF2##</CODE> and <CODE>##CDXWRF3##</CODE> at the beginning of the line of the definition of certain variables
** Adding <CODE>CDXWRF=4</CODE>, one needs to remove the comment <CODE>##CDXWRF1##</CODE>, <CODE>##CDXWRF2##</CODE>, <CODE>##CDXWRF3##</CODE> and <CODE>##CDXWRF4##</CODE> at the beginning of the line of the definition of certain variables
** Example for <CODE>CDXWRF=3</CODE>
<PRE style="shell">
sed -i 's/##CDXWRF1##//g' Registry/registry.cordex_comp
sed -i 's/##CDXWRF2##//g' Registry/registry.cordex_comp
sed -i 's/##CDXWRF3##//g' Registry/registry.cordex_comp
</PRE>
* Additionally, one can also get the instantaneous values for the variables which only certain statistics (accumulation, minimum, mean, ...) are provided. In order to get them, one need to:
# Search in <CODE>phys/module_diagnostics_driver.F</CODE> and <CODE>phys/module_diag_cordex.F</CODE> the lines of code marked with <CODE>INSTVALS</CODE> and change accordingly (not fully tested).
# Modify <CODE>Registry/registry.cordex</CODE> accordingly (removing <CODE>##INST##</CODE> at the beginning of the line of the definition of certain variables, and adding <CODE>h19</CODE> to certain others)
compile as always
<PRE style="shell">
./compile em_real >& compile.log
</PRE>
=== From Lluís Fita GIT at CIMA ===
This is an old repository without uptdates of the module. It has different branches for each previous version of the module (cdxwrf1, cdxwrf2) available for different WRF versions. It's use is discouraged.
# Get the code
<PRE style="shell">
git https://git.cima.fcen.uba.ar/lluis.fita/cdxwrf.git
</PRE>
Select the right branch and WRF version and proceed as before
== From tar file ==


# Untar the file
# Untar the file
Línea 25: Línea 102:
include registry.cordex
include registry.cordex
</PRE>
</PRE>
== Compilation ==
# Clean the code (in order to avoid to run again configure one can make a copy of the <CODE>configure.wrf</CODE> and recover it after the clean, otherwise it is erased)
# Clean the code (in order to avoid to run again configure one can make a copy of the <CODE>configure.wrf</CODE> and recover it after the clean, otherwise it is erased)
<PRE>
<PRE>

Revisión actual - 12:17 30 jul 2025

Installation

These steps must be followed prior the re-compilation of the WRF model and assuming that the process is started where the code resides (WRFV3). NOTE: make sure that the already compiled version of WRF and the version of the module are the same!

From repository

  1. Get the code, there are different options

From Lluís Fita's WRF fork (recomended)

This is the unique source of the module with the latest version (currently v3.1) of the module. It is going to be proposed to be incorporated into the official WRF GIT repository.

  1. Get the code
git clone git@github.com:LluisFB/WRF.git
git submodule update --init --recursive
git checkout cdxwrf
  1. Clean the code (in order to avoid to run again configure one can make a copy of the `configure.wrf` and recover it after the clean, otherwise it is erased)
cp configure.wrf configure.cordex.wrf
./clean -a
cp configure.cordex.wrf configure.wrf
  1. edit the configure.wrf and add the line (after the line -DNETCDF)
                      -DCORDEXDIAG \
  1. Set up (or not) the pre-compilation variable CDXWRF (after the line -DCORDEXDIAG)
                      -DCDXWRF=[value] \

Accordingly to the value given to the pre-compilation variable CDXWRF one obtains:

  • Without adding the variable: all CORDEX Core variables
  • CDXWRF=1 CORDEX 'Tier' variables: clivg, clivh, zmla, [cape/cin/zlfc/plfc/lidx]{min/max/mean} (if in namelist.input convxtrm_diag = 1), colmax, prhf
  • CDXWRF=2 The same as with CDXWRF=1 and additional variables: ua, va, ws, ta, press, zg, hur, hus, tfog, fogvisbltymin, fogvisbltymax, fogvisbltymean, tds[min/max/mean], tws[min/max/mean]
  • CDXWRF=3 The same as with CDXWRF=1,2 and additional residence-time variables
  • CDXWRF=4 The same as with CDXWRF=1,2 and 3 and the Water-Budget relarted ones: wbacdiabh, wbacpw, wbacpw[c/r/s/i/g/h], wbacf, wbacf[c/r/s/i/g/h], wbacz, wbacz[c/r/s/i/g/h], wbacdiabh{l/m/h}, wbacpw{l/m/h}, wbacpw[c/r/s/i/g/h]{l/m/h}, wbacf{l/m/h}, wbacf[c/r/s/i/g/h]{l/m/h}, wbacz{l/m/h}, wbacz[c/r/s/i/g/h]{l/m/h}

Simultaneosuly, one needs to:

  • make a copy of Registry/registry.cordex
cp Registry/registry.cordex Registry/registry.cordex_comp
  • modify the Registry/registry.cordex_comp accordingly to the value of CDXWRF:
    • Without adding CDXWRF, nothing needs to be changed
    • Adding CDXWRF=1, one needs to remove the comment ##CDXWRF1## at the beginning of the line of the definition of certain variables
    • Adding CDXWRF=2, one needs to remove the comment ##CDXWRF1## and ##CDXWRF2## at the beginning of the line of the definition of certain variables
    • Adding CDXWRF=3, one needs to remove the comment ##CDXWRF1##, ##CDXWRF2## and ##CDXWRF3## at the beginning of the line of the definition of certain variables
    • Adding CDXWRF=4, one needs to remove the comment ##CDXWRF1##, ##CDXWRF2##, ##CDXWRF3## and ##CDXWRF4## at the beginning of the line of the definition of certain variables
    • Example for CDXWRF=3
sed -i 's/##CDXWRF1##//g' Registry/registry.cordex_comp
sed -i 's/##CDXWRF2##//g' Registry/registry.cordex_comp
sed -i 's/##CDXWRF3##//g' Registry/registry.cordex_comp
  • Additionally, one can also get the instantaneous values for the variables which only certain statistics (accumulation, minimum, mean, ...) are provided. In order to get them, one need to:
  1. Search in phys/module_diagnostics_driver.F and phys/module_diag_cordex.F the lines of code marked with INSTVALS and change accordingly (not fully tested).
  2. Modify Registry/registry.cordex accordingly (removing ##INST## at the beginning of the line of the definition of certain variables, and adding h19 to certain others)

compile as always

./compile em_real >& compile.log

From Lluís Fita GIT at CIMA

This is an old repository without uptdates of the module. It has different branches for each previous version of the module (cdxwrf1, cdxwrf2) available for different WRF versions. It's use is discouraged.

  1. Get the code
git https://git.cima.fcen.uba.ar/lluis.fita/cdxwrf.git

Select the right branch and WRF version and proceed as before

From tar file

  1. Untar the file
$ tar xvfz WRFV[VERSION]_CORDEX.tar.gz
  1. It deflates all the required files and the modified orignal WRF files
main/depend.common
dyn_em/solve_em.F
dyn_em/start_em.F
phys/module_diagnostics_driver.F
phys/module_diag_cordex.F
phys/module_diagvar_cordex.F
phys/module_diag_pld.F
phys/Makefile
README.cordex
Registry/registry.cordex
Registry/registry.diags
  1. On the Registry/Registry.EM add the following line (after the last line include registry.bdy_perturb (on WRFV3.7.1, WRFV3.8.1), registry.new3d_wif (on WRFV3.9.1.1)) and on WFRV40 after the last line include registry.trad_fields in registry.em_shared_collection
include registry.cordex

Compilation

  1. Clean the code (in order to avoid to run again configure one can make a copy of the configure.wrf and recover it after the clean, otherwise it is erased)
$ cp configure.wrf configure.cordex.wrf
$ ./clean -a
$ cp configure.cordex.wrf configure.wrf
  1. edit the `configure.wrf' and add the line (after the line -DNETCDF and/or –DCLWRFGHG)
                      -DCORDEXDIAG
  1. Set up (or not) the pre-compilation variable CDXWRF (after the line -DCORDEXDIAG)
                      -DCDXWRF=[value] \
    • Accordingly to the value given to the pre-compilation variable CDXWRF one obtains:
      • Without adding the variable: all CORDEX 'Core' variables
      • CORDEX 'Tier1' variables: clivg, clivh, zmla, [cape/cin/zlfc/plfc/lidx]{min/max/mean}
                      -DCDXWRF=1 \
      • The same as with CDXWRF=1 and additional variables: ua, va, ws, ta, press, zg, hur, hus, tfog, fogvisbltymin, fogvisbltymax, fogvisbltymean, tdsmin, tdsmax, tdsmean and the Water-Budget relarted ones: wbacdiabh, wbacpw, wbacpw[c/r/s/i/g/h], wbacf, wbacf[c/r/s/i/g/h], wbacz, wbacz[c/r/s/i/g/h], wbacdiabh{l/m/h}, wbacpw{l/m/h}, wbacpw[c/r/s/i/g/h]{l/m/h}, wbacf{l/m/h}, wbacf[c/r/s/i/g/h]{l/m/h}, wbacz{l/m/h}, wbacz[c/r/s/i/g/h]{l/m/h}
                      -DCDXWRF=2 \
  • Simultanesouly, one needs to modify the Registry/registry.cordex accordingly to the value of CDXWRF:
      • Without adding CDXWRF, nothing needs to be changed
      • Adding CDXWRF=1, one needs to remove the comment ##CDXWRF1## at the beginning of the line of the definition of certain variables
      • Adding CDXWRF=2, one needs to remove the comment ##CDXWRF1## and ##CDXWRF2## at the beginning of the line of the definition of certain variables
  1. Additionally, one can also get the instantaneous values for the variables which only certain statistics (accumulation, minimum, mean, ...) are provided. In order to get them, one need to:
    1. Search in phys/module_diagnostics_driver.F and phys/module_diag_cordex.F the lines of code marked with 'INSTVALS' and change accordingly.
    2. Modify Registry/registry.cordex accordingly (removing ##INST## at the beginning of the line of the definition of certain variables, and adding 'h9' to certain others)
  1. compile as always
$ ./compile em_real >& compile.log

Back to the main page CDXWRF