mom4_Aeolus_lad_Xcoarse ======================= MOM4 at coarse resolution with land_lad and Aeolus. This is an arttempt to couple Aelous with MOM4 and land_lad. It is derived from CM2M_coarse_BLING , but with the atmosphere component replaced with Aeolus. Also the ocean setup is modified, as in the om3Xcoare series of experiments that were done at PIK. Model resolution: mom4_Aeolus_lad_Xcoarse om3Xcoarse CM2M_coarse_BLING om3_core Ocean 120x80x23 120x80x23 120x80x23 360x200x50 Land 96x60 144x90 96x60 144x90 Atmos 96x48 144x90 96x60 144x90 Supergrid resolutions: Ocean: 240x160 240x160 240x160 720x400 Land: 192x120 288x180 192x120 288x180 Atmos: 192x96 288x180 192x120 288x180 # # begin of grid generation # mkdir exp/mom4_Aeolus_lad_Xcoarse/INPUT cd exp/mom4_Aeolus_lad_Xcoarse/INPUT cp -p ../../../exp/CM2M_coarse_BLING/INPUT/ocean_mosaic.nc \ ../../../exp/CM2M_coarse_BLING/INPUT/ocean_hgrid.nc \ ../../../exp/CM2M_coarse_BLING/INPUT/ocean_vgrid.nc \ . # the make_coupler_mosaic tool requires a dimension named ntiles # but this is not contained in the GFDL-provided topog.nc files # sigh. the name topog.nc is hardcoded in the ocean topography module ncap2 -o topog.nc -s 'defdim("ntiles",1)' ../../../exp/CM2M_coarse_BLING/INPUT/topog.nc cp -p ../../../exp/CM2M_coarse_BLING/INPUT/land_hgrid.nc \ ../../../exp/CM2M_coarse_BLING/INPUT/land_mosaic.nc \ . ../../../src/tools/make_hgrid/make_hgrid --grid_type regular_lonlat_grid --nxbnd 2 --nybnd 2 --xbnds 0,360 --ybnds -90,90 \ --simple_dx 3.75 --simple_dy 3.75 \ --nlon 192 --nlat 96 \ --grid_name aeolus_hgrid ../../../src/tools/make_solo_mosaic/make_solo_mosaic --dir . --num_tiles 1 \ --tile_file aeolus_hgrid.nc --mosaic_name aeolus_mosaic ../../../src/tools/make_coupler_mosaic/make_coupler_mosaic \ --atmos_mosaic aeolus_mosaic.nc \ --ocean_mosaic ocean_mosaic.nc \ --ocean_topog topog.nc \ --land_mosaic land_mosaic.nc \ --mosaic_name grid_spec \ --check #mv -i mosaic.nc grid_spec.nc ## ## collect data files ## cp -p ../../CM2M_coarse_BLING/INPUT/coupler.res . ln ../../CM2M_coarse_BLING/INPUT/*.res* . rm ice_bling.res.nc ocean_bling* rm ocmip2_abiotic* ice_ocmip2_abiotic.res.nc # # for the ocean # cp -p ../../CM2M_coarse_BLING/INPUT/basin_mask.nc \ ../../CM2M_coarse_BLING/INPUT/geothermal_heating.nc \ ../../CM2M_coarse_BLING/INPUT/mixdownslope_mask.nc \ ../../CM2M_coarse_BLING/INPUT/ocean_age.res.nc \ ../../CM2M_coarse_BLING/INPUT/ocean_temp_salt.res.nc \ ../../CM2M_coarse_BLING/INPUT/restore_mask.nc \ ../../CM2M_coarse_BLING/INPUT/chl.nc \ . # for large files, make links to preserve disk space ln ../../CM2M_coarse_BLING/INPUT/navy_topography.data.nc \ ../../CM2M_coarse_BLING/INPUT/tideamp.nc \ ../../CM2M_coarse_BLING/INPUT/roughness_amp.nc \ . # create a salinity restore file #ncks -F -v salt -d zaxis_1,1 -o salt_sfc_restore.nc-extracted-from-CM2M_coarse_BLING \ # ../../CM2M_coarse_BLING/INPUT/ocean_temp_salt.res.nc #ncatted -a units,Time,m,c,"days since 1900-01-01 00:00:00" \ # -a calendar_type,Time,c,c,NOLEAP \ # -a modulo,Time,c,c,"" salt_sfc_restore.nc-extracted-from-CM2M_coarse_BLING ln ../../om3Xcoarse/INPUT/salt_sfc_restore.nc-extracted-from-CM2M_coarse_BLING . ln -s salt_sfc_restore.nc-extracted-from-CM2M_coarse_BLING salt_sfc_restore.nc # sigh. correct metadata for the fregrid tool #ncatted -o temp_sfc_restore+cartesian.nc -a cartesian_axis\,MONTH_IRREG\,c\,c\,T ../../../exp/om3_core1/INPUT/temp_sfc_restore.nc #../../../src/tools/fregrid/fregrid \ # --input_mosaic ../../om3_core1/INPUT/ocean_mosaic.nc \ # --output_mosaic ./ocean_mosaic.nc \ # --input_file temp_sfc_restore+cartesian.nc \ # --output_file temp_sfc_restore.nc \ # --scalar_field temp ln ../../om3Xcoarse/INPUT/temp_sfc_restore.nc . # # For the land_lad model # > CM2M_coarse_BLING CM2.1p1 EBM ICCMp1 > horizontal grid cells 96x60 144x90 144x90 144x90 > resolution in degrees 3.75x3.0 2.5x2.0 2.5x2.0 2.5x2.0 > > soil/soil.F90 > soil.res.nc (if exists) - 144x90 - - > soil.res (if exists) - - - - > > > soil/land_properties.F90 > cover_type_field 360x180 360x180 360x180 360x180 (only EBM and ICCMp1 identical) > cover_type_field.nc 360x180 360x180 360x180 360x180 (all identical) > ground_type_field 360x180 360x180 360x180 360x180 (all identical) > groundwater_residence_time_field 360x180 360x180 360x180 360x180 (all identical) > > > soil/rivers.F90 > river_destination_field 96x80 96x80 96x80 96x60 (all different!) > > vegetation/vegetation.F90 > vegetation.res.nc (if exists) - 144x90 - - > vegetation.res (if exists) - - - - > > land_param/climap_albedo.F90 > albedo.data.nc 180x90 180x90 180x90 180x90 > albedo.data - - - - > ss_albedo.data (optional) - - - - > > topography/topography.F90 > navy_topography.data.nc 2160x1080 2160x1080 2160x1080 2160x1080 (all identical) > > not used anywhere?? - might be diagnostic output files? > soil_albedo.nc 360x180 - - - > groundwater_residence.nc 360x180 - - - > ground_type.nc 360x180 - - - ln ../../CM2M_coarse_BLING/INPUT/cover_type_field \ ../../CM2M_coarse_BLING/INPUT/ground_type_field \ ../../CM2M_coarse_BLING/INPUT/groundwater_residence_time_field \ ../../CM2M_coarse_BLING/INPUT/river_destination_field \ ../../CM2M_coarse_BLING/INPUT/albedo.data.nc \ . # # for the coupler # cp -p ../../CM2M_coarse_BLING/INPUT/coupler.res . cp -p ../../CM2M_coarse_BLING/INPUT/*table* . cp -p ../../CM2M_coarse_BLING/INPUT/input.nml* . ## data_table # remove all ATM entries for OCMIP-related data, # except the constant setting for ``normal'' CO2 "ATM" , "co2_bot" , "" , "" , .false. , 286.0e-6 # apparently this forces a globally and temporal constant CO2 concentration ## field table # enable CO2 tracers # sigh. enabling CO2 tracer for the atmos model requires full use of atmos_shared/tracer_driver/atmos_tracer_driver.F90 . # The coupler main loop invokes atmos_tracer_driver_gather_data(Atm%fields, Atm%tr_bot), # which in turn tries to handle the CO2 tracer, if that is enabled in the field table. # However, the proper initialization of the tracer driver is not done by the coupler, # but is expected to be done by the atmosphere model. # Currently, that is not implemented in Aeolus. # Copy ocean tracer settings from om3Xcoarse-28800-4-noBryanLewis-nodissip-slab # (ocean-only with simplified and accelerated advection) # for first experiments, use the fast ``upwind'' advection scheme, # leave only temp and salt as tracers in the ocean, remove all others. ## diag_table # for first experiments, use a table that puts out all the fields that go through coupler as instant values, # not aggregated by averaging or anything. ## input.nml # strip out all entries for the CM2 atmosphere # for the ocean use the modifications from om3Xcoarse-28800-4-noBryanLewis-nodissip-slab experiment # insert entries for Aeolus # # for Aeolus # Usually, Aeolus uses longitudes runnning -180 to 180 in its data files. However, the FMS atmosphere grid runs 0 to 360 degrees. Thus, Aeolus input files must be rotated in longitude. Also, the flag lon_0_360 must be set to true. The script rotate_0to360.sh uses ferret to do the axis rotation. ## ## Initial Conditions ## The CM2M_coarse_BLING setup provides restart files for the ocean and ice, but land and atmosphere do cold-start from artificial initial conditions. However, Aeolus currently is not designed to handle large differences between planet surface and lowest atmosphere layer. First approach: * Let the CM2M_coarse_BLING run from the provided restart / initial conditions for 50 years. * Among the generated RESTART files is atmos_coupled.res.nc , which is saved by the generic atmos_coupled/atmos_model.F90 . For Aeolus, we are mainly interested in t_bot and sphum. Per default, those two are not written by atmos_model.F90, but can be enabled by setting restart_tbot_qbot = .true. in atmos_model_nml . * That atmos_coupled.res.nc must be regridded to Aeolus grid. * t_bot and sphum must be extracted to a file named AEOLUS_input_1976-2001_yseasmean.cdf, variables T500mb (PlanetaryBoundaryLayerPhysics::LoadFromFile) => Question: in PlanetaryBoundaryLayerPhysics::LoadFromFile() the read-in temperatures are added with 5000. * 6.e-3 ?? QS (WaterVaporTransfer::LoadFromFile) cp -p ../../work/CM2M_coarse_BLING/history/00520101.RESTART.tar.bz2 \ CM2M_coarse_BLING-00520101.RESTART.tar.bz2 tar xvjf CM2M_coarse_BLING-00520101.RESTART.tar.bz2 00520101.RESTART/atmos_coupled.res.nc # Sigh. The atmos_coupled module wants to read variables glon_bnd, glat_bnd, dt from atmos_coupled.res.nc, # but the fregrid tool does not handle those. # Thus we first copy those variables from the original file and then set new values by hand. ../../../src/tools/fregrid/fregrid \ --input_mosaic ../../CM2M_coarse_BLING/INPUT/atmos_mosaic.nc \ --output_mosaic ./aeolus_mosaic.nc \ --input_file 00520101.RESTART/atmos_coupled.res.nc \ --output_file atmos_coupled.res.prelim.nc \ --scalar_field lprec\,fprec\,gust\,t_bot\,q_bot ncks -A -v glon_bnd\,glat_bnd\,dt 00520101.RESTART/atmos_coupled.res.nc atmos_coupled.res.prelim.nc ncap2 -s 'glon_bnd=96;glat_bnd=48;dt=3600;' atmos_coupled.res.prelim.nc atmos_coupled.res.nc rm -f atmos_coupled.res.prelim.nc # Now we can create an Aeolus initial conditions file. ncrename -v q_bot\,QS -v t_bot\,TS atmos_coupled.res.nc AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart ## sigh. Aelous requires floats, but here we have doubles. ## simplest way seems to do ncdump/edit/ncgen. #ncdump ... ; vi ... ; ncgen ... ; # -> not any more # maybe we can use ncap2 to do renaming and type conversion in one go. ncatted -a units\,TS\,o\,c\,K AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart #ncatted -a units\,QS\,o\,c\,"" AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart # sigh. this dumps core. easiest workaround seems to do it in the ncdump-edit-ncgen step ncatted -a units\,QS\,o\,c\,"1" AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart ln -s AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart AEOLUS_input_1976-2001_yseasmean.cdf ## TODO: also regrid atmos_tracers.res.nc # copy restart data for coupler, ocean, ice and land to INPUT directory so that all # submodels can start with data from consistent time steps. mv 00520101.RESTART/coupler.res \ 00520101.RESTART/ocean_* \ 00520101.RESTART/ice_* \ 00520101.RESTART/soil.res.nc \ 00520101.RESTART/vegetation.res.nc \ . ---- Sigh. The restart file is an instantaneous snapshot of the model state. In particular, that one has a blob of very cold air over NE Russia / Siberia, which causes Aeolus to crash after a few months of simulation time, because that cold air blob is amplified while moving around slowly, eventually causing lapse rate and troposphere height to exceed any sane validity limits. Workaround approach: Create a restart file as smoothed average over a period of time. That should eliminate such extreme blobs. We choose half-day intervals, because CM2M_coarse_BLING uses diurnal cycle, and we do not want to amplify e.g. solar irradiation in one hemisphere, and darkness / coldness in the other, but smooth those out. Unfortunately, land and atmosphere models do not support intermediate restart files. Thus; Let CM2M_coarse-BLING run for 50 years, as above. Restart it for every half day of the following year, yielding 720 restart points at 12 hours distance. Use the NetCDF ensemble averager ncea from the NCO tools to create an average of the NetCDF files of those 720 snapshots. There are two non-netCDF restart files. One is the coupler.res, which specifies the time stamp of the restart. The other is ocean_tracer.res, which contains a list of checksums, which can be used to check repeatability of model runs. It is written out, but never read back in. Thus, the ncea is the only tool we need to apply here. Regridding of atmosphere restart information must be done from the output of the ncea, as above. We can simply copy 00520101.RESTART/coupler.res, as above, to our synthetic averaged checkpoint directory. This synthetical, averaged checkpoint looks significantly ``nicer'' than the above-used single snapshot from time 00520101. cd exp/mom4_Aeolus_lad_Xcoarse/ mkdir INPUT-Restart-from-0052-halfdaily-avg cd INPUT-Restart-from-0052-halfdaily-avg/ mv ../../../work/CM2M_coarse_BLING/history/RESTART-ncea CM2M_coarse_BLING-Restart-0052-ncea ../../../src/tools/fregrid/fregrid \ --input_mosaic ../../CM2M_coarse_BLING/INPUT/atmos_mosaic.nc \ --output_mosaic ./aeolus_mosaic.nc \ --input_file CM2M_coarse_BLING-Restart-0052-ncea/atmos_coupled.res.nc \ --output_file atmos_coupled.res.prelim.nc \ --scalar_field lprec\,fprec\,gust\,t_bot\,q_bot ## TODO: also regrid atmos_tracers.res.nc ncks -A -v glon_bnd\,glat_bnd\,dt CM2M_coarse_BLING-Restart-0052-ncea/atmos_coupled.res.nc atmos_coupled.res.prelim.nc ncap2 -s 'glon_bnd=96;glat_bnd=48;dt=3600;' atmos_coupled.res.prelim.nc atmos_coupled.res.nc rm -f atmos_coupled.res.prelim.nc ncrename -v q_bot\,QS -v t_bot\,TS atmos_coupled.res.nc AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart ncatted -a units\,TS\,o\,c\,K AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart ncatted -a units\,QS\,o\,c\,"1" AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart cp -avu CM2M_coarse_BLING-Restart-0052-ncea/coupler.res \ CM2M_coarse_BLING-Restart-0052-ncea/ocean_* \ CM2M_coarse_BLING-Restart-0052-ncea/ice_* \ CM2M_coarse_BLING-Restart-0052-ncea/soil.res.nc \ CM2M_coarse_BLING-Restart-0052-ncea/vegetation.res.nc . ==== Stock checking: Stock diagnostics are sent to the diag manager if input.nml/coupler_nml/check_stocks=1 (every time step) For each of the component models XXX = { ATM LND ICE OCN }, and stock elements yyy = { water heat salt }, 3 diagnostics can be sent: XXXyyyStocksChange_Flux XXXyyyStocksChange_Comp XXXyyyStocksChange_Diff Also, stock reports are printed to stdout , or into a separate stocks.out file: Total =S(t) not sent to diag manager Change=S(t)-S(0) equal to XXXyyyStocksChange_Comp Input =F(t) equal to XXXyyyStocksChange_Flux Diff =F(t) - (S(t)-S(0)) equal to XXXyyyStocksChange_Diff Error =Diff/S(0) parameter :: NELEMS=3 character, dimension(NELEMS) :: STOCK_NAMES=(/'water', 'heat ', 'salt '/) parameter :: NSIDES = 3 ! top, bottom, side type stock_type real :: q_start = 0.0 ! total stocks at start time real :: q_now = 0.0 ! total stocks at time t ! The dq's below are the stocks increments at the present time ! delta_t * surf integr of flux ! one for each side (ISTOCK_TOP, ISTOCK_BOTTOM, ISTOCK_SIDE) real :: dq(NSIDES) = 0.0 ! stock increments at present time on the Ice grid real :: dq_IN(NSIDES) = 0.0 ! stock increments at present time on the Ocean grid end type stock_type type(stock_type), dimension(NELEMS) :: Atm_stock, Ocn_stock, Lnd_stock, Ice_stock parameter :: NCOMPS=4 character, dimension(NCOMPS) :: COMP_NAMES=(/'ATM', 'LND', 'ICE', 'OCN'/) StocksChange_Flux f_value == Input: StocksChange_Comp c_value == Change: StocksChange_Diff fmc_value == Diff: Total: == Input: + Input(0) Total : q_now Change: q_now - q_start Input: f_value Diff : f_value - c_value Error: (f_value - c_value)/(1+q_start) comp = ISTOCK_ATM ISTOCK_LND ISTOCK_ICE ISTOCK_OCN f_ice_grid(comp) = sum(stck%dq) f_ocn_grid(comp) = sum(stck%dq_IN) f_ocn_btf(comp) = stck%dq_IN( ISTOCK_BOTTOM ) q_start(comp) = stck%q_start q_now(comp) = stck%q_now c_value(comp) = q_now(comp) - q_start(comp) == f_value(comp) = f_ice_grid(comp) resp. f_ocn_grid(comp) fmc_value = f_value(comp)-c_value(comp) ===== Regarding initial conditions again: The averaged-over-one-year RESTART conditions are difficult to use, because they do not correspond to a meaningful point in the solar year. Next approach: create a 30-year climatology for one day of the year. We choose 21st of March. Because CM2M_coarse_BLING simluates the diurnal solar cycle, we take 4 snapshots for each of the 30 21-March days, to average-out the diurnal cycle, so that it is more suitable for Aeolus. mkdir /scratch/01/petri/RESTART-0321clim for i in *RESTART* ; do tar xvjf $i -C /scratch/01/petri/RESTART-0321clim ; done cd /scratch/01/petri/RESTART-0321clim for i in `ls -1 0052032100.RESTART/ | grep nc` ; do echo $i ; ncea -y avg */$i $i ; done cd ...../exp/mom4_Aeolus_lad_Xcoarse/ mkdir INPUT-Restart-from-21-mar-clim cd INPUT-Restart-from-21-mar-clim/ mkdir CM2M_coarse_BLING-Restart-21-mar-clim/ mv /scratch/01/petri/RESTART-0321clim/*.nc CM2M_coarse_BLING-Restart-21-mar-clim/ ../../../src/tools/fregrid/fregrid \ --input_mosaic ../../CM2M_coarse_BLING/INPUT/atmos_mosaic.nc \ --output_mosaic ./aeolus_mosaic.nc \ --input_file CM2M_coarse_BLING-Restart-21-mar-clim/atmos_coupled.res.nc \ --output_file atmos_coupled.res.prelim.nc \ --scalar_field lprec\,fprec\,gust\,t_bot\,q_bot # fregrid complains that it cannot determine the axis for dimensions pfull, lat, lon. # Thus, add apropriate attributes: rm -f atmos_tracers.res.nc ncatted -a cartesian_axis\,pfull\,c\,c\,"Z" \ -a cartesian_axis\,lat\,c\,c\,"Y" \ -a cartesian_axis\,lon\,c\,c\,"X" \ CM2M_coarse_BLING-Restart-21-mar-clim/atmos_tracers.res.nc ../../../src/tools/fregrid/fregrid \ --input_mosaic ../../CM2M_coarse_BLING/INPUT/atmos_mosaic.nc \ --output_mosaic ./aeolus_mosaic.nc \ --input_file CM2M_coarse_BLING-Restart-21-mar-clim/atmos_tracers.res.nc \ --output_file atmos_tracers.res.nc \ --scalar_field sphum\,liq_wat\,ice_wat\,cld_amt ncks -A -v glon_bnd\,glat_bnd\,dt CM2M_coarse_BLING-Restart-21-mar-clim/atmos_coupled.res.nc atmos_coupled.res.prelim.nc ncap2 -s 'glon_bnd=96;glat_bnd=48;dt=3600;' atmos_coupled.res.prelim.nc atmos_coupled.res.nc rm -f atmos_coupled.res.prelim.nc ncrename -v q_bot\,QS -v t_bot\,TS atmos_coupled.res.nc AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart ncatted -a units\,TS\,o\,c\,K AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart #ncatted -a units\,QS\,o\,c\,"1" AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart ncatted -a units\,QS\,d\,c\,"" AEOLUS_input_1976-2001_yseasmean.cdf-fromCM2Mrestart # copy restart data for coupler, ocean, ice and land to INPUT directory so that all # submodels can start with data from consistent time steps. cp -avu CM2M_coarse_BLING-Restart-21-mar-clim/coupler.res \ CM2M_coarse_BLING-Restart-21-mar-clim/ocean_* \ CM2M_coarse_BLING-Restart-21-mar-clim/ice_* \ CM2M_coarse_BLING-Restart-21-mar-clim/soil.res.nc \ CM2M_coarse_BLING-Restart-21-mar-clim/vegetation.res.nc . # the data_table from CM2M_coarse_BLING also specifies to use INPUT/ocmip2_siple_co2_atm_am2_bc-1-9999.nc # that must also be regridded to atmos resolution ncatted -a cartesian_axis\,TIME\,c\,c\,"T" \ ../../../exp/CM2M_coarse_BLING/INPUT/ocmip2_siple_co2_atm_am2_bc-1-9999.nc \ ocmip2_siple_co2_atm_am2_bc-1-9999-prelim.nc ../../../src/tools/fregrid/fregrid \ --input_mosaic ../../../exp/CM2M_coarse_BLING/INPUT/atmos_mosaic.nc \ --output_mosaic ./aeolus_mosaic.nc \ --input_file ocmip2_siple_co2_atm_am2_bc-1-9999-prelim.nc \ --output_file ocmip2_siple_co2_atm_am2_bc-1-9999.nc \ --scalar_field CO2