PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Macros | Functions | Variables
calcalcs.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include "calcalcs.h"

Go to the source code of this file.

Macros

#define CCS_ERROR_MESSAGE_LEN   8192
 
#define CCS_VALID_SIG   89132412
 
#define CCS_MAX_N_COUNTRY_CODES   5000
 

Functions

static int c_isleap_gregorian (int year, int *leap)
 
static int c_isleap_gregorian_y0 (int year, int *leap)
 
static int c_isleap_julian (int year, int *leap)
 
static int c_isleap_never (int year, int *leap)
 
static int c_date2jday_julian (int year, int month, int day, int *jday)
 
static int c_date2jday_gregorian (int year, int month, int day, int *jday)
 
static int c_date2jday_gregorian_y0 (int year, int month, int day, int *jday)
 
static int c_date2jday_noleap (int year, int month, int day, int *jday)
 
static int c_date2jday_360_day (int year, int month, int day, int *jday)
 
static int c_jday2date_julian (int jday, int *year, int *month, int *day)
 
static int c_jday2date_gregorian (int jday, int *year, int *month, int *day)
 
static int c_jday2date_gregorian_y0 (int jday, int *year, int *month, int *day)
 
static int c_jday2date_noleap (int jday, int *year, int *month, int *day)
 
static int c_jday2date_360_day (int jday, int *year, int *month, int *day)
 
static int c_dpm_julian (int year, int month, int *dpm)
 
static int c_dpm_gregorian (int year, int month, int *dpm)
 
static int c_dpm_gregorian_y0 (int year, int month, int *dpm)
 
static int c_dpm_noleap (int year, int month, int *dpm)
 
static int c_dpm_360_day (int year, int month, int *dpm)
 
static int date_ge (int year, int month, int day, int y2, int m2, int d2)
 
static int date_le (int year, int month, int day, int y2, int m2, int d2)
 
static int date_lt (int year, int month, int day, int y2, int m2, int d2)
 
static int date_gt (int year, int month, int day, int y2, int m2, int d2)
 
static int set_xition_extra_info (calcalcs_cal *cal)
 
static void ccs_dump_xition_dates (void)
 
static void ccs_gxd_add_country (char *code, char *longname, int year, int month, int day)
 
static void ccs_init_country_database (void)
 
calcalcs_calccs_init_calendar (const char *calname)
 
int ccs_isleap (calcalcs_cal *calendar, int year, int *leap)
 
int ccs_dpm (calcalcs_cal *calendar, int year, int month, int *dpm)
 
int ccs_jday2date (calcalcs_cal *calendar, int jday, int *year, int *month, int *day)
 
int ccs_date2jday (calcalcs_cal *calendar, int year, int month, int day, int *jday)
 
int ccs_date2doy (calcalcs_cal *calendar, int year, int month, int day, int *doy)
 
int ccs_doy2date (calcalcs_cal *calendar, int year, int doy, int *month, int *day)
 
int ccs_dayssince (calcalcs_cal *calendar_orig, int year_orig, int month_orig, int day_orig, int ndays_since, calcalcs_cal *calendar_new, int *year_new, int *month_new, int *day_new)
 
int ccs_get_xition_date (const char *country_code, int *year, int *month, int *day)
 
int ccs_set_xition_date (calcalcs_cal *calendar, int year, int month, int day)
 
char * ccs_err_str (int error_code)
 
void ccs_free_calendar (calcalcs_cal *cc)
 

Variables

static char error_message [CCS_ERROR_MESSAGE_LEN]
 
static int dpm_idx1 [] = {-99, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
 
static int dpm_leap_idx1 [] = {-99, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
 
static int spm_idx1 [] = {-99, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}
 
static int ccs_n_country_codes = 0
 
static ccs_country_codeccs_xition_dates [CCS_MAX_N_COUNTRY_CODES]
 
static int have_initted_country_codes = 0