Regridding for the new Landice Component: Difference between revisions

No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
--[[User:Mathomp4|Matt Thompson]] 06:30, 28 December 2012 (PST)
--[[User:Mathomp4|Matt Thompson]] 06:30, 28 December 2012 (PST)


== Step 1: Obtain a LANDICE internal restart that works at 21z ==
== Obtain a Landice internal restart that works at 21z ==


Larry Takacs sent this email about the new LANDICE:
Larry Takacs sent this email about the new Landice:
  <nowiki>All,
  <nowiki>All,


Line 26: Line 26:
Larry</nowiki>
Larry</nowiki>


These restarts are at 00z, but for simplicity's sake, I prefer 21z as that works with Larry's HISTORY.rc from gcm_setup easily.
These restarts are at 00z, but for simplicity's sake, I prefer 21z as that works with Larry's <tt>HISTORY.rc</tt> from <tt>gcm_setup</tt> easily.


=== Get 00z restarts ===
=== Get 00z restarts ===
Line 71: Line 71:
=== Rename 21z restarts ===
=== Rename 21z restarts ===


We are going to use Joe Stassi's regrid.pl script to do our regridding from MERRA and for regridding our LANDICE restart. So, we need to get the restart in the correct format.
We are going to use Joe Stassi's <tt>regrid.pl</tt> script to do our regridding from MERRA and for regridding our Landice restart. So, we need to get the restart in the correct format.


  $ cd $NOBACKUP/Restarts-G20/c90-Full-newlandice
  $ cd $NOBACKUP/Restarts-G20/c90-Full-newlandice
Line 110: Line 110:
  turb_internal_rst.e19901128_21z.Ganymed-1_0_p2.Ganymed-1_0_M_CF0090x6C_DE0360xPE0180
  turb_internal_rst.e19901128_21z.Ganymed-1_0_p2.Ganymed-1_0_M_CF0090x6C_DE0360xPE0180


== Step 2: Regrid from MERRA ==
== Regrid from MERRA ==


The next step is to use Joe Stassi's regrid.pl script to create some restarts at 21z on 1990-NOV-28. We'll first run two sets of runs at 144x91 and c48 to get a command to use for automated generation.
The next step is to use Joe Stassi's <tt>regrid.pl</tt> script to create some restarts at 21z on 1990-NOV-28. We'll first run two sets of runs at 144x91 and c48 to get a command to use for automated generation.


=== Run regrid.pl for 144x91 ===
=== Run regrid.pl for 144x91 ===
Line 231: Line 231:
...<snip></nowiki>
...<snip></nowiki>


When this succeeds you'll have a file, b_d5_merra_jan89.19901128_21z.CMD, which details how the regrid.pl ran:
When this succeeds you'll have a file, <tt>b_d5_merra_jan89.19901128_21z.CMD</tt>, which details how the regrid.pl ran:
  $ cat b_d5_merra_jan89.19901128_21z.CMD  
  $ cat b_d5_merra_jan89.19901128_21z.CMD  
  #!/usr/local/bin/csh
  #!/usr/local/bin/csh
Line 259: Line 259:


We now have commands we can use to regrid to other resolutions. Create a simple script to do so:
We now have commands we can use to regrid to other resolutions. Create a simple script to do so:
  <nowiki>-- borg01s121:...nobackup/mathomp4/Restarts-G20/Scripts --                                                                                                  (1075) > cat regrid.latlon.csh
  <nowiki>#!/usr/local/bin/csh
#!/usr/local/bin/csh


set ESMABIN = /gpfsm/dswdev/mathomp4/Models/Ganymed-2_0_UNSTABLE/GEOSagcm/Linux/bin
set ESMABIN = /gpfsm/dswdev/mathomp4/Models/Ganymed-2_0_UNSTABLE/GEOSagcm/Linux/bin
Line 276: Line 275:
                             -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid c_d5_merra_jan89 -rs 3 -oceanout c
                             -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid c_d5_merra_jan89 -rs 3 -oceanout c


# 576x361
# C48
# -------
# ---
 
echo y | $ESMABIN/regrid.pl -merra -ymd 19901128 -hr 21 -grout C48 -outdir /gpfsm/dnb31/mathomp4/Restarts-G20/c48 \
                            -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid C48_d5_merra_jan89 -rs 3 -oceanout c
 
# C90
# ---
 
echo y | $ESMABIN/regrid.pl -merra -ymd 19901128 -hr 21 -grout C90 -outdir /gpfsm/dnb31/mathomp4/Restarts-G20/c90 \
                            -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid C90_d5_merra_jan89 -rs 3 -oceanout c</nowiki>
 
with other similar commands for other resolutions.
 
== Regrid the good Landice restarts ==
 
Now we need to work at getting a good Landice restart. Again we'll use Joe's script.
 
This time a run leads to a run-line like:
 
<nowiki>echo y | $ESMABIN/regrid.pl -ymd 19901128 -hr 21 -grout b -outdir /gpfsm/dnb31/mathomp4/Restarts-G20/144x91-newlandice \
                            -d /gpfsm/dnb31/mathomp4/Restarts-G20/c90-Full-newlandice -tagin Ganymed-1_0_M -oceanin c \
                            -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid b_newlandice -rs 2 -oceanout c</nowiki>
 
This line only does surface restarts (<tt>-rs 2</tt>).
 
== Rename restarts for GCM ==
 
This isn't very automated yet, but I first use this script to rename the restarts as made above:
 
<nowiki>$ ls
C48_d5_merra_jan89.19901128_21z.CMD                      C48_d5_merra_jan89.landice_internal_rst.19901128_21z.bin
C48_d5_merra_jan89.19901128_21z.log                      C48_d5_merra_jan89.moist_internal_rst.19901128_21z.bin
C48_d5_merra_jan89.agcm_import_rst.19901128_21z.bin      C48_d5_merra_jan89.pchem_internal_rst.19901128_21z.bin
C48_d5_merra_jan89.catch_internal_rst.19901128_21z.bin  C48_d5_merra_jan89.saltwater_internal_rst.19901128_21z.bin
C48_d5_merra_jan89.fvcore_internal_rst.19901128_21z.bin  regrid.C48_d5_merra_jan89.19901128_21z.48x288.j
C48_d5_merra_jan89.lake_internal_rst.19901128_21z.bin    regrid.o1536224
$ restart_name_clean
Changing C48_d5_merra_jan89.agcm_import_rst.19901128_21z.bin to agcm_import_rst...
Changing C48_d5_merra_jan89.catch_internal_rst.19901128_21z.bin to catch_internal_rst...
Changing C48_d5_merra_jan89.fvcore_internal_rst.19901128_21z.bin to fvcore_internal_rst...
Changing C48_d5_merra_jan89.lake_internal_rst.19901128_21z.bin to lake_internal_rst...
Changing C48_d5_merra_jan89.landice_internal_rst.19901128_21z.bin to landice_internal_rst...
Changing C48_d5_merra_jan89.moist_internal_rst.19901128_21z.bin to moist_internal_rst...
Changing C48_d5_merra_jan89.pchem_internal_rst.19901128_21z.bin to pchem_internal_rst...
Changing C48_d5_merra_jan89.saltwater_internal_rst.19901128_21z.bin to saltwater_internal_rst...
No cap_restart found. Copying from lower directory...
Removing regrid.o*...
Removing agcm_import_rst...
Removing *.CMD
Removing *.log
Removing *.j
$ ls
cap_restart*        fvcore_internal_rst  landice_internal_rst  pchem_internal_rst
catch_internal_rst  lake_internal_rst    moist_internal_rst    saltwater_internal_rst</nowiki>
where <tt>cap_restart</tt> is just "<tt>19901128 210000</tt>" and <tt>restart_name_clean</tt> is:
<nowiki>#!/bin/bash
 
if test -n "$(find . -maxdepth 1 -name '*_rst*bin' -print -quit)"
then
  for file in *_rst*bin
  do
      origfile=$file
      file=${file%.*.*bin}
      file=${file#*.}
      echo "Changing $origfile to $file..."
      mv $origfile $file
  done
fi
 
if [ ! -e cap_restart ]
then
  echo "No cap_restart found. Copying from lower directory..."
  if [ -e ../cap_restart ]
  then
      cp ../cap_restart .
  else
      echo "No cap_restart found below. Exiting!"
      exit 10
  fi
fi
 
if [ -e regrid.rc ]
then
  echo "Removing regrid.rc..."
  /bin/rm regrid.rc
fi
 
if [ -e regrid.o* ]
then
  echo "Removing regrid.o*..."
  /bin/rm regrid.o*
fi


echo y | $ESMABIN/regrid.pl -merra -ymd 19901128 -hr 21 -grout d -outdir /gpfsm/dnb31/mathomp4/Restarts-G20/576x361 \
if [ -e agcm_import_rst ]
                            -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid d_d5_merra_jan89 -rs 3 -oceanout c
then
  echo "Removing agcm_import_rst..."
  /bin/rm agcm_import_rst
fi


# 1152x721
if [ -e *.CMD ]
# --------
then
  echo "Removing *.CMD"
  /bin/rm *.CMD
fi


echo y | $ESMABIN/regrid.pl -merra -ymd 19901128 -hr 21 -grout e -outdir /gpfsm/dnb31/mathomp4/Restarts-G20/1152x721 \
if [ -e *.log ]
                            -nobkg -nolbl -nolcv -tagout Ganymed-1_0_M -newid e_d5_merra_jan89 -rs 3 -oceanout c</nowiki>
then
  echo "Removing *.log"
  /bin/rm *.log
fi


and something similarly ugly for the cubed-sphere.
if [ -e *.j ]
then
  echo "Removing *.j"
  /bin/rm *.j
fi</nowiki>
Do the same thing in the <tt>newlandice</tt> directories as well.


== Step 3: Regrid the good Landice restarts ==
== Move the new Landice restart ==


Now we need to work at getting a good LANDICE restart. Again we'll use Joe's script.
Well, this is simple, just move, say <tt>c48-newlandice/landice_internal_rst</tt> to <tt>c48</tt>.