Skip to content

Commit

Permalink
Per #2547, rename Pinterp classes as Wrf
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Dec 20, 2023
1 parent fad94d1 commit fc7be22
Show file tree
Hide file tree
Showing 16 changed files with 215 additions and 214 deletions.
4 changes: 2 additions & 2 deletions src/libcode/vx_data2d_factory/data2d_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using namespace std;
#include "grdfiletype_to_string.h"
#include "data2d_grib.h"
#include "data2d_nc_met.h"
#include "data2d_nc_pinterp.h"
#include "data2d_nc_wrf.h"
#include "data2d_nc_cf.h"
#ifdef WITH_UGRID
#include "data2d_ugrid.h"
Expand Down Expand Up @@ -83,7 +83,7 @@ MetPythonDataFile * p = nullptr;

case FileType_NcWrf:
case FileType_NcPinterp:
mtddf = new MetNcPinterpDataFile;
mtddf = new MetNcWrfDataFile;
break;

case FileType_NcCF:
Expand Down
4 changes: 2 additions & 2 deletions src/libcode/vx_data2d_factory/var_info_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using namespace std;
#include "var_info_grib.h"
#include "var_info_nc_cf.h"
#include "var_info_nc_met.h"
#include "var_info_nc_pinterp.h"
#include "var_info_nc_wrf.h"
#include "var_info_ugrid.h"

#ifdef WITH_PYTHON
Expand Down Expand Up @@ -87,7 +87,7 @@ VarInfo * VarInfoFactory::new_var_info(GrdFileType type)

case FileType_NcWrf:
case FileType_NcPinterp:
vi = new VarInfoNcPinterp;
vi = new VarInfoNcWrf;
break;

case FileType_Python_Numpy:
Expand Down
97 changes: 49 additions & 48 deletions src/libcode/vx_data2d_nc_cf/Makefile.in

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/libcode/vx_data2d_nc_wrf/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ include ${top_srcdir}/Make-include

noinst_LIBRARIES = libvx_data2d_nc_wrf.a
libvx_data2d_nc_wrf_a_SOURCES = \
get_pinterp_grid.cc get_pinterp_grid.h \
pinterp_file.cc pinterp_file.h \
var_info_nc_pinterp.cc var_info_nc_pinterp.h \
data2d_nc_pinterp.cc data2d_nc_pinterp.h \
get_wrf_grid.cc get_wrf_grid.h \
wrf_file.cc wrf_file.h \
var_info_nc_wrf.cc var_info_nc_wrf.h \
data2d_nc_wrf.cc data2d_nc_wrf.h \
vx_data2d_nc_wrf.h
libvx_data2d_nc_wrf_a_CPPFLAGS = ${MET_CPPFLAGS}
128 changes: 64 additions & 64 deletions src/libcode/vx_data2d_nc_wrf/Makefile.in

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,52 @@ using namespace std;
#include <stdlib.h>
#include <cmath>

#include "data2d_nc_pinterp.h"
#include "get_pinterp_grid.h"
#include "data2d_nc_wrf.h"
#include "get_wrf_grid.h"
#include "vx_nc_util.h"
#include "vx_math.h"
#include "vx_log.h"

////////////////////////////////////////////////////////////////////////
//
// Code for class MetNcPinterpDataFile
// Code for class MetNcWrfDataFile
//
////////////////////////////////////////////////////////////////////////

MetNcPinterpDataFile::MetNcPinterpDataFile() {
MetNcWrfDataFile::MetNcWrfDataFile() {

nc_pinterp_init_from_scratch();

}

////////////////////////////////////////////////////////////////////////

MetNcPinterpDataFile::~MetNcPinterpDataFile() {
MetNcWrfDataFile::~MetNcWrfDataFile() {

close();
}

////////////////////////////////////////////////////////////////////////

MetNcPinterpDataFile::MetNcPinterpDataFile(const MetNcPinterpDataFile &) {
MetNcWrfDataFile::MetNcWrfDataFile(const MetNcWrfDataFile &) {

mlog << Error << "\nMetNcPinterpDataFile::MetNcPinterpDataFile(const MetNcPinterpDataFile &) -> "
mlog << Error << "\nMetNcWrfDataFile::MetNcWrfDataFile(const MetNcWrfDataFile &) -> "
<< "should never be called!\n\n";
exit(1);
}

////////////////////////////////////////////////////////////////////////

MetNcPinterpDataFile & MetNcPinterpDataFile::operator=(const MetNcPinterpDataFile &) {
MetNcWrfDataFile & MetNcWrfDataFile::operator=(const MetNcWrfDataFile &) {

mlog << Error << "\nMetNcPinterpDataFile::operator=(const MetNcPinterpDataFile &) -> "
mlog << Error << "\nMetNcWrfDataFile::operator=(const MetNcWrfDataFile &) -> "
<< "should never be called!\n\n";
exit(1);
}

////////////////////////////////////////////////////////////////////////

void MetNcPinterpDataFile::nc_pinterp_init_from_scratch() {
void MetNcWrfDataFile::nc_pinterp_init_from_scratch() {

PinterpNc = (PinterpFile *) 0;

Expand All @@ -73,7 +73,7 @@ void MetNcPinterpDataFile::nc_pinterp_init_from_scratch() {

////////////////////////////////////////////////////////////////////////

void MetNcPinterpDataFile::close() {
void MetNcWrfDataFile::close() {

if(PinterpNc) { delete PinterpNc; PinterpNc = (PinterpFile *) 0; }

Expand All @@ -82,14 +82,14 @@ void MetNcPinterpDataFile::close() {

////////////////////////////////////////////////////////////////////////

bool MetNcPinterpDataFile::open(const char * _filename) {
bool MetNcWrfDataFile::open(const char * _filename) {

close();

PinterpNc = new PinterpFile;

if(!PinterpNc->open(_filename)) {
mlog << Error << "\nMetNcPinterpDataFile::open(const char *) -> "
mlog << Error << "\nMetNcWrfDataFile::open(const char *) -> "
<< "unable to open NetCDF file \"" << _filename << "\"\n\n";
close();

Expand All @@ -111,7 +111,7 @@ bool MetNcPinterpDataFile::open(const char * _filename) {

////////////////////////////////////////////////////////////////////////

void MetNcPinterpDataFile::dump(ostream & out, int depth) const {
void MetNcWrfDataFile::dump(ostream & out, int depth) const {

if(PinterpNc) PinterpNc->dump(out, depth);

Expand All @@ -120,11 +120,11 @@ void MetNcPinterpDataFile::dump(ostream & out, int depth) const {

////////////////////////////////////////////////////////////////////////

bool MetNcPinterpDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {
bool MetNcWrfDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {
bool status = false;
double pressure;
ConcatString level_str;
VarInfoNcPinterp * vinfo_nc = (VarInfoNcPinterp *) &vinfo;
VarInfoNcWrf * vinfo_nc = (VarInfoNcWrf *) &vinfo;
NcVarInfo *info = (NcVarInfo *) 0;

// Initialize the data plane
Expand Down Expand Up @@ -157,7 +157,7 @@ bool MetNcPinterpDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {
// Check that the valid time matches the request
if(vinfo.valid() > 0 && vinfo.valid() != plane.valid()) {

mlog << Warning << "\nMetNcPinterpDataFile::data_plane() -> "
mlog << Warning << "\nMetNcWrfDataFile::data_plane() -> "
<< "for \"" << vinfo.req_name() << "\" variable, the valid "
<< "time does not match the requested valid time: ("
<< unix_to_yyyymmdd_hhmmss(plane.valid()) << " != "
Expand All @@ -168,7 +168,7 @@ bool MetNcPinterpDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {
// Check that the lead time matches the request
if(vinfo.lead() > 0 && vinfo.lead() != plane.lead()) {

mlog << Warning << "\nMetNcPinterpDataFile::data_plane() -> "
mlog << Warning << "\nMetNcWrfDataFile::data_plane() -> "
<< "for \"" << vinfo.req_name() << "\" variable, the lead "
<< "time does not match the requested lead time: ("
<< sec_to_hhmmss(plane.lead()) << " != "
Expand Down Expand Up @@ -196,13 +196,13 @@ bool MetNcPinterpDataFile::data_plane(VarInfo &vinfo, DataPlane &plane) {

////////////////////////////////////////////////////////////////////////

int MetNcPinterpDataFile::data_plane_array(VarInfo &vinfo,
int MetNcWrfDataFile::data_plane_array(VarInfo &vinfo,
DataPlaneArray &plane_array) {
int i, i_dim, n_level, status, lower, upper;
ConcatString level_str;
double pressure, min_level, max_level;
bool found = false;
VarInfoNcPinterp *vinfo_nc = (VarInfoNcPinterp *) &vinfo;
VarInfoNcWrf *vinfo_nc = (VarInfoNcWrf *) &vinfo;
LongArray dim = vinfo_nc->dimension();
NcVarInfo *info = (NcVarInfo *) 0;

Expand Down Expand Up @@ -250,7 +250,7 @@ int MetNcPinterpDataFile::data_plane_array(VarInfo &vinfo,
// Check that the valid time matches the request
if(vinfo.valid() > 0 && vinfo.valid() != cur_plane.valid()) {

mlog << Warning << "\nMetNcPinterpDataFile::data_plane_array() -> "
mlog << Warning << "\nMetNcWrfDataFile::data_plane_array() -> "
<< "for \"" << vinfo.req_name() << "\" variable, the valid "
<< "time does not match the requested valid time: ("
<< unix_to_yyyymmdd_hhmmss(cur_plane.valid()) << " != "
Expand All @@ -261,7 +261,7 @@ int MetNcPinterpDataFile::data_plane_array(VarInfo &vinfo,
// Check that the lead time matches the request
if(vinfo.lead() > 0 && vinfo.lead() != cur_plane.lead()) {

mlog << Warning << "\nMetNcPinterpDataFile::data_plane_array() -> "
mlog << Warning << "\nMetNcWrfDataFile::data_plane_array() -> "
<< "for \"" << vinfo.req_name() << "\" variable, the lead "
<< "time does not match the requested lead time: ("
<< sec_to_hhmmss(cur_plane.lead()) << " != "
Expand Down Expand Up @@ -307,7 +307,7 @@ int MetNcPinterpDataFile::data_plane_array(VarInfo &vinfo,

////////////////////////////////////////////////////////////////////////

int MetNcPinterpDataFile::index(VarInfo &vinfo){
int MetNcWrfDataFile::index(VarInfo &vinfo){
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
////////////////////////////////////////////////////////////////////////


#ifndef __MET_VX_DATA_2D_NC_PINTERP_H__
#define __MET_VX_DATA_2D_NC_PINTERP_H__
#ifndef __MET_VX_DATA_2D_NC_WRF_H__
#define __MET_VX_DATA_2D_NC_WRF_H__


////////////////////////////////////////////////////////////////////////
Expand All @@ -21,22 +21,22 @@

#include "data_plane.h"
#include "data_class.h"
#include "var_info_nc_pinterp.h"
#include "pinterp_file.h"
#include "var_info_nc_wrf.h"
#include "wrf_file.h"
#include "two_to_one.h"


////////////////////////////////////////////////////////////////////////


class MetNcPinterpDataFile : public Met2dDataFile {
class MetNcWrfDataFile : public Met2dDataFile {

private:

void nc_pinterp_init_from_scratch();

MetNcPinterpDataFile(const MetNcPinterpDataFile &);
MetNcPinterpDataFile & operator=(const MetNcPinterpDataFile &);
MetNcWrfDataFile(const MetNcWrfDataFile &);
MetNcWrfDataFile & operator=(const MetNcWrfDataFile &);

//
// NetCDF file
Expand All @@ -46,8 +46,8 @@ class MetNcPinterpDataFile : public Met2dDataFile {

public:

MetNcPinterpDataFile();
~MetNcPinterpDataFile();
MetNcWrfDataFile();
~MetNcWrfDataFile();

//
// set stuff
Expand Down Expand Up @@ -87,13 +87,13 @@ class MetNcPinterpDataFile : public Met2dDataFile {
////////////////////////////////////////////////////////////////////////


inline GrdFileType MetNcPinterpDataFile::file_type () const { return ( FileType_NcPinterp ); }
inline GrdFileType MetNcWrfDataFile::file_type () const { return ( FileType_NcPinterp ); }


////////////////////////////////////////////////////////////////////////


#endif /* __MET_VX_DATA_2D_NC_PINTERP_H__ */
#endif /* __MET_VX_DATA_2D_NC_WRF_H__ */


////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using namespace netCDF;
#include "vx_math.h"
#include "vx_nc_util.h"

#include "get_pinterp_grid.h"
#include "get_wrf_grid.h"


////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
////////////////////////////////////////////////////////////////////////


#ifndef __GET_PINTERP_GRID_H__
#define __GET_PINTERP_GRID_H__
#ifndef __GET_WRF_GRID_H__
#define __GET_WRF_GRID_H__


////////////////////////////////////////////////////////////////////////
Expand All @@ -37,7 +37,7 @@ extern bool get_pinterp_grid(netCDF::NcFile &, Grid &);
////////////////////////////////////////////////////////////////////////


#endif /* __GET_PINTERP_GRID_H__ */
#endif /* __GET_WRF_GRID_H__ */


////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit fc7be22

Please sign in to comment.