/* Subroutines to set all arguments required by isf_write functions to null. Real and float variables are set to ISF_NULL, this parameter is set in 'isf_bul.h'. Strings are set to the null string. The write routines check for these values and use them to distinguish between zero and undefined arguments. */ #include "isf_bul.h" int nullify_data_type(char *data_type, char *subtype, char *data_format, char *subformat) { strcpy(data_type,""); strcpy(subtype,""); strcpy(data_format,""); strcpy(subformat,""); return 0; } int nullify_event_id(char *evid, char *region) { strcpy(evid,""); strcpy(region,""); return 0; } int nullify_origin(int *yyyy, int *mm, int *dd, int *hh, int *mi, int *ss, int *msec, char *timfix, float *stime, float *sdobs, float *lat, float *lon, char *epifix, float *smaj, float *smin, int *strike, float *depth, char *depfix, float *sdepth, int *ndef, int *nsta, int *gap, float *mindist, float *maxdist, char *antype, char *loctype, char *etype, char *author, char *origid) { *yyyy = ISF_NULL; *mm = ISF_NULL; *dd = ISF_NULL; *hh = ISF_NULL; *mi = ISF_NULL; *ss = ISF_NULL; *msec = ISF_NULL; *timfix =' '; *stime = ISF_NULL; *sdobs = ISF_NULL; *lat = ISF_NULL; *lon = ISF_NULL; *epifix =' '; *smaj = ISF_NULL; *smin = ISF_NULL; *strike = ISF_NULL; *depth = ISF_NULL; *depfix = ' '; *sdepth = ISF_NULL; *ndef = ISF_NULL; *nsta = ISF_NULL; *gap = ISF_NULL; *mindist = ISF_NULL; *maxdist = ISF_NULL; *antype = ' '; *loctype = ' '; strcpy(etype,""); strcpy(author,""); strcpy(origid,""); return 0; } int nullify_origin_param(char **param, char **value, int *numparam) { *numparam = 0; return 0; } int nullify_momten(int *scale_factor, float *scalar_moment, float *fclvd, float *mrr, float *mtt, float *mpp, float *mrt, float *mtp, float *mpr,int *nsta1, int *nsta2 ,char *author, float *scalar_moment_unc, float *fclvd_unc, float *mrr_unc, float *mtt_unc, float *mpp_unc, float *mrt_unc, float *mtp_unc, float *mpr_unc, int *ncomp1, int *ncomp2, float *duration) { *scale_factor = ISF_NULL; *scalar_moment = ISF_NULL; *fclvd = ISF_NULL; *mrr = ISF_NULL; *mtt = ISF_NULL; *mpp = ISF_NULL; *mrt = ISF_NULL; *mtp = ISF_NULL; *mpr = ISF_NULL; *nsta1 = ISF_NULL; *nsta2 = ISF_NULL; strcpy(author,""); *scalar_moment_unc = ISF_NULL; *fclvd_unc = ISF_NULL; *mrr_unc = ISF_NULL; *mtt_unc = ISF_NULL; *mpp_unc = ISF_NULL; *mrt_unc = ISF_NULL; *mtp_unc = ISF_NULL; *mpr_unc = ISF_NULL; *ncomp1 = ISF_NULL; *ncomp2 = ISF_NULL; *duration = ISF_NULL; return 0; } int nullify_fault_plane (char *f_type, float *strike, float *dip, float *rake, int *np, int *ns, char *f_plane, char *author) { strcpy(f_type,""); *strike = ISF_NULL; *dip = ISF_NULL; *rake = ISF_NULL; *np = ISF_NULL; *ns = ISF_NULL; strcpy(f_plane,""); strcpy(author,""); return 0; } int nullify_axes(int *scale_factor, float *t_val, float *t_azim, float *t_pl, float *b_val, float *b_azim, float *b_pl, float *p_val, float *p_azim, float *p_pl, char *author) { *scale_factor = ISF_NULL; *t_val = ISF_NULL; *t_azim = ISF_NULL; *t_pl = ISF_NULL; *b_val = ISF_NULL; *b_azim = ISF_NULL; *b_pl = ISF_NULL; *p_val = ISF_NULL; *p_azim = ISF_NULL; *p_pl = ISF_NULL; strcpy(author,""); return 0; } int nullify_axes_err(float *t_val_unc, float *t_azim_unc, float *t_pl_unc, float *b_val_unc, float *b_azim_unc, float *b_pl_unc, float *p_val_unc, float *p_azim_unc, float *p_pl_unc, float *fclvd) { *t_val_unc = ISF_NULL; *t_azim_unc = ISF_NULL; *t_pl_unc = ISF_NULL; *b_val_unc = ISF_NULL; *b_azim_unc = ISF_NULL; *b_pl_unc = ISF_NULL; *p_val_unc = ISF_NULL; *p_azim_unc = ISF_NULL; *p_pl_unc = ISF_NULL; *fclvd = ISF_NULL; return 0; } int nullify_effects(char *heard, char *felt, char *damage, char *casualties, char *uplift, char *subsidence, char *fault, char *tsunami, char *seiche, char *volcano, char *acoustic, char *gravity, char *t_wave, char *liquification, char *geyser, char *landslide, char *sandblow, char *cracks, char *lights, char *odours, char *loctype, float *lat, float *lon, float *dist, float *azim, char *country, char *postcode, char *net, char *sta, float *intensity1, char *modifier, float *intensity2, char *scale, char* author) { *heard = ' '; *felt = ' '; *damage = ' '; *casualties = ' '; *uplift = ' '; *subsidence = ' '; *fault = ' '; *tsunami = ' '; *seiche = ' '; *volcano = ' '; *acoustic = ' '; *gravity = ' '; *t_wave = ' '; *liquification = ' '; *geyser = ' '; *landslide = ' '; *sandblow = ' '; *cracks = ' '; *lights = ' '; *odours = ' '; strcpy(loctype,""); *lat = ISF_NULL; *lon = ISF_NULL; *dist = ISF_NULL; *azim = ISF_NULL; strcpy(country,""); strcpy(postcode,""); strcpy(net,""); strcpy(sta,""); *intensity1 = ISF_NULL; *modifier = ' '; *intensity2 = ISF_NULL; strcpy(scale,""); strcpy(author,""); return 0; } int nullify_netmag( char* magtype, char* magind, float* mag, float* magerr, int* nsta, char* author, char* origid) { strcpy(magtype,""); *magind = ' '; *mag = ISF_NULL; *magerr = ISF_NULL; *nsta = ISF_NULL; strcpy(author,""); strcpy(origid,""); return 0; } int nullify_netmag_sta(char **sta, int *n) { *n = 0; return 0; } int nullify_netmag_basis(char *param, char *value) { strcpy(param,""); strcpy(value,""); return 0; } int nullify_phase(char *sta, float *dist, float *esaz, char *phase, int *hh, int *mi, int *ss, int *msec, float *timeres, float *azim, float *azimres, float *slow, float *slowres, char *timedef, char *azimdef, char *slowdef, float *snr, float *amp, float *per, char *picktype, char *sp_fm, char *detchar, char *magtype, char *magind, float *mag, char *arrid) { strcpy(sta,""); *dist = ISF_NULL; *esaz = ISF_NULL; strcpy(phase,""); *hh = ISF_NULL; *mi = ISF_NULL; *ss = ISF_NULL; *msec = ISF_NULL; *timeres = ISF_NULL; *azim = ISF_NULL; *azimres = ISF_NULL; *slow = ISF_NULL; *slowres = ISF_NULL; *timedef = ' '; *azimdef = ' '; *slowdef = ' '; *snr = ISF_NULL; *amp = ISF_NULL; *per = ISF_NULL; *picktype = ' '; *sp_fm = ' '; *detchar = ' '; strcpy(magtype,""); *magind = ' '; *mag = ISF_NULL; strcpy(arrid,""); return 0; } int nullify_phase_measure(char **param, char **value, int *numparam) { *numparam = 0; return 0; } int nullify_phase_origid(char *origid) { strcpy(origid,""); return 0; } int nullify_phase_info(char *net, char *chan, char *filter, float *filter_min, float *filter_max, char *phase, int *yyyy, int *mm, int *dd, float *time_unc, float *time_weight, float *azim_unc, float *azim_weight, float *slow_unc, float *slow_weight, float *amp_unc, float *per_unc, float *mag_unc, char *author, char *arrid) { strcpy(net,""); strcpy(chan,""); *filter = ' '; *filter_min = ISF_NULL; *filter_max = ISF_NULL; strcpy(phase,""); *yyyy = ISF_NULL; *mm = ISF_NULL; *dd = ISF_NULL; *time_unc = ISF_NULL; *time_weight = ISF_NULL; *azim_unc = ISF_NULL; *azim_weight = ISF_NULL; *slow_unc = ISF_NULL; *slow_weight = ISF_NULL; *amp_unc = ISF_NULL; *per_unc = ISF_NULL; *mag_unc = ISF_NULL; strcpy(author,""); strcpy(arrid,""); return 0; } int nullify_phase_min(float *timeoffset, float *azoffset, float *slowoffset, float *ampoffset, float *peroffset, float *magoffset) { *timeoffset = ISF_NULL; *azoffset = ISF_NULL; *slowoffset = ISF_NULL; *ampoffset = ISF_NULL; *peroffset = ISF_NULL; *magoffset = ISF_NULL; return 0; } int nullify_phase_max(float *timeoffset, float *azoffset, float *slowoffset, float *ampoffset, float *peroffset, float *magoffset) { *timeoffset = ISF_NULL; *azoffset = ISF_NULL; *slowoffset = ISF_NULL; *ampoffset = ISF_NULL; *peroffset = ISF_NULL; *magoffset = ISF_NULL; return 0; } int nullify_phase_correc(float *timecorr, float *azcorr,float *slowcorr, float *ampcorr, float *percorr,float *magcorr) { *timecorr = ISF_NULL; *azcorr = ISF_NULL; *slowcorr = ISF_NULL; *ampcorr = ISF_NULL; *percorr = ISF_NULL; *magcorr = ISF_NULL; return 0; } int nullify_phase_original(char *chan, char *sta, int *yyyy, int *mm, int *dd, int *hh, int *mi, int *ss, int *msec, float *azim, float *slow, float *amp, float *per, float *mag) { strcpy(chan,""); *yyyy = ISF_NULL; *mm = ISF_NULL; *dd = ISF_NULL; *hh = ISF_NULL; *mi = ISF_NULL; *ss = ISF_NULL; *msec = ISF_NULL; *azim = ISF_NULL; *slow = ISF_NULL; *amp = ISF_NULL; *per = ISF_NULL; *mag = ISF_NULL; return 0; } int nullify_comment(char *comment) { strcpy(comment,""); return 0; }