Ejemplo n.º 1
0
 def test_ezqkdef_file_ezgprm_ezgfstp(self):
     rmn.fstopt(rmn.FSTOP_MSGLVL,rmn.FSTOPI_MSG_CATAST)
     ATM_MODEL_DFILES = os.getenv('ATM_MODEL_DFILES')
     myfile = os.path.join(ATM_MODEL_DFILES.strip(),'bcmk/geophy.fst')
     funit = rmn.fstopenall(myfile,rmn.FST_RO)
     (ni,nj) = (201,100)
     gp = {
         'shape' : (ni,nj),
         'ni' : ni,
         'nj' : nj,
         'grtyp' : 'Z',
         'ig1'   : 2002,
         'ig2'   : 1000,
         'ig3'   : 0,
         'ig4'   : 0,
         'grref' : 'E',
         'ig1ref' : 900,
         'ig2ref' : 0,
         'ig3ref' : 43200,
         'ig4ref' : 43200,
         'iunit'  : funit
         }
     gid1 = rmn.ezqkdef(gp)
     a = rmn.ezgfstp(gid1)
     rmn.fstcloseall(funit)
     self.assertTrue(gid1>=0)
     gp['id'] = gid1
     gprm = rmn.ezgxprm(gid1)
     for k in gprm.keys():
         self.assertEqual(gp[k],gprm[k])
     self.assertEqual(a['nomvarx'].strip(),'>>')
     self.assertEqual(a['nomvary'].strip(),'^^')
     rmn.gdrls(gid1)
Ejemplo n.º 2
0
 def test_ezqkdef_file_ezgprm_ezgfstp(self):
     rmn.fstopt(rmn.FSTOP_MSGLVL,rmn.FSTOPI_MSG_CATAST)
     ATM_MODEL_DFILES = os.getenv('ATM_MODEL_DFILES')
     myfile = os.path.join(ATM_MODEL_DFILES.strip(),'bcmk/geophy.fst')
     funit = rmn.fstopenall(myfile,rmn.FST_RO)
     (ni,nj) = (201,100)
     gp = {
         'shape' : (ni,nj),
         'ni' : ni,
         'nj' : nj,
         'grtyp' : 'Z',
         'ig1'   : 2002,
         'ig2'   : 1000,
         'ig3'   : 0,
         'ig4'   : 0,
         'grref' : 'E',
         'ig1ref' : 900,
         'ig2ref' : 0,
         'ig3ref' : 43200,
         'ig4ref' : 43200,
         'iunit'  : funit
         }
     gid1 = rmn.ezqkdef(gp)
     a = rmn.ezgfstp(gid1)
     rmn.fstcloseall(funit)
     self.assertTrue(gid1>=0)
     gp['id'] = gid1
     gprm = rmn.ezgxprm(gid1)
     for k in gprm.keys():
         self.assertEqual(gp[k],gprm[k])
     self.assertEqual(a['nomvarx'].strip(),'>>')
     self.assertEqual(a['nomvary'].strip(),'^^')
     rmn.gdrls(gid1)
Ejemplo n.º 3
0
 def test_ezgkdef_fmem_ezgxprm(self):
     gp = self.getGridParams_ZE()
     gid1 = rmn.ezgdef_fmem(gp['ni'],gp['nj'],gp['grtyp'],gp['grref'],
                            gp['ig1ref'],gp['ig2ref'],gp['ig3ref'],gp['ig4ref'],
                            gp['ax'],gp['ay'])
     self.assertTrue(gid1>=0)
     gp['id'] = gid1
     gprm = rmn.ezgxprm(gid1)
     for k in gprm.keys():
         self.assertEqual(gp[k],gprm[k],'(%s) Expected: %s, Got: %s :: %s' % (k,repr(gp[k]),repr(gprm[k]),repr(gprm)))
     rmn.gdrls(gid1)
Ejemplo n.º 4
0
 def test_ezgkdef_fmem_ezgxprm(self):
     gp = self.getGridParams_ZE()
     gid1 = rmn.ezgdef_fmem(gp['ni'],gp['nj'],gp['grtyp'],gp['grref'],
                            gp['ig1ref'],gp['ig2ref'],gp['ig3ref'],gp['ig4ref'],
                            gp['ax'],gp['ay'])
     self.assertTrue(gid1>=0)
     gp['id'] = gid1
     gprm = rmn.ezgxprm(gid1)
     for k in gprm.keys():
         self.assertEqual(gp[k],gprm[k],'(%s) Expected: %s, Got: %s :: %s' % (k,repr(gp[k]),repr(gprm[k]),repr(gprm)))
     rmn.gdrls(gid1)
Ejemplo n.º 5
0
 def test_ezqkdef_ezgxprm(self):
     gp = self.getGridParams_L()
     gid1 = rmn.ezqkdef(gp['ni'],gp['nj'],gp['grtyp'],
                        gp['ig1'],gp['ig2'],gp['ig3'],gp['ig4'])
     self.assertTrue(gid1>=0)
     gp['id'] = gid1
     gp['grref'] = ''
     gp['ig1ref'] = 0
     gp['ig2ref'] = 0
     gp['ig3ref'] = 0
     gp['ig4ref'] = 0
     gprm = rmn.ezgxprm(gid1)
     for k in gprm.keys():
         self.assertEqual(gp[k],gprm[k])
     rmn.gdrls(gid1)
Ejemplo n.º 6
0
 def test_ezqkdef_ezgxprm(self):
     gp = self.getGridParams_L()
     gid1 = rmn.ezqkdef(gp['ni'],gp['nj'],gp['grtyp'],
                        gp['ig1'],gp['ig2'],gp['ig3'],gp['ig4'])
     self.assertTrue(gid1>=0)
     gp['id'] = gid1
     gp['grref'] = ''
     gp['ig1ref'] = 0
     gp['ig2ref'] = 0
     gp['ig3ref'] = 0
     gp['ig4ref'] = 0
     gprm = rmn.ezgxprm(gid1)
     for k in gprm.keys():
         self.assertEqual(gp[k],gprm[k])
     rmn.gdrls(gid1)