Skip to content
Snippets Groups Projects
Select Git revision
  • b27440c94d3d10b8b285017e8bff1cedf9f362f9
  • master default protected
  • dev protected
  • replication_test
  • 551-init-broker-service-permissions
  • release-1.10 protected
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • release-1.9 protected
  • 499-standalone-compute-service-2
  • 539-load-tests
  • hotfix/helm-chart
  • luca_ba_new_interface
  • 534-bug-when-adding-access-to-user-that-is-not-registered-at-dashboard-service
  • release-1.8 protected
  • 533-integrate-semantic-recommendation
  • feature/openshift
  • 518-spark-doesn-t-map-the-headers-correct
  • 485-fixity-checks
  • 530-various-schema-problems-with-subsets
  • release-1.7 protected
  • v1.10.1 protected
  • v1.10.0-rc13 protected
  • v1.10.0-rc12 protected
  • v1.10.0-rc11 protected
  • v1.10.0-rc10 protected
  • v1.10.0-rc9 protected
  • v1.10.0-rc8 protected
  • v1.10.0-rc7 protected
  • v1.10.0-rc6 protected
  • v1.10.0-rc5 protected
  • v1.10.0-rc4 protected
  • v1.10.0-rc3 protected
  • v1.10.0-rc2 protected
  • v1.10.0rc1 protected
  • v1.10.0rc0 protected
  • v1.10.0 protected
  • v1.9.3 protected
  • v1.9.2 protected
  • v1.9.2-rc0 protected
  • v1.9.1 protected
41 results

data-db.md

Blame
  • prepare_wrfrundir.py 1.17 KiB
    """Prepare WRF run directories, to use wrf.exe then
    
    Args:
        init_time (str): YYYY-MM-DD_HH:MM
    
    Returns:
        None
    """
    import os, sys, shutil
    import datetime as dt
    
    from config.cfg import exp
    from config.cluster import cluster
    from dartwrf.utils import symlink, copy, link_contents
    from dartwrf import prepare_namelist
    
    if __name__ == '__main__':
    
        init_time = dt.datetime.strptime(sys.argv[1], '%Y-%m-%d_%H:%M')
    
        for iens in range(1, exp.n_ens+1):
            print('preparing ens', iens)
    
            rundir = cluster.wrf_rundir(iens)
            os.makedirs(rundir, exist_ok=True)
            link_contents(cluster.srcdir, rundir)
            print('linking ideal and wrf.exe:')
            symlink(cluster.ideal, rundir+'/ideal.exe')
            symlink(cluster.wrfexe, rundir+'/wrf.exe')
    
            # time not important, but general settings
            prepare_namelist.run(iens, begin=init_time, end=dt.datetime(2008, 7, 30, 23),
                                archive=False)
    
            # prepare input profiles
            if hasattr(exp, 'input_profile'):
                input_prof = (exp.input_profile).replace('<iens>', str(iens).zfill(3))
                symlink(input_prof, rundir+'/input_sounding')
    
        print('finished.')